Write a program in which you create an array of size twelve

Assignment Help Data Structure & Algorithms
Reference no: EM13934145

A football team plays a football game almost every month. It stores the number of goals scored per month in an array of size 12. The number of goals scored on January is stored in the first element of the array (at index 0). The number of goals scored on February is stored in the 2nd element of the array (at index 1) and so on.

a. The team wants to find the month in which they scored the maximum number of goals. Write a function named String Max(int[] A) that takes the array of goals and returns the month name (a string value) in which they scored the maximum number of goals.

b. The team wants to find the number of games played during the year. Note that if the team didn't play a game in a specific month, the value -1 is found. Write a function int NbGames(int[] A) to count the number of games played during the year.

c. Write a program in which you create an array of size 12 having all its elements initialized to -1. Then ask the user to enter a month number and the number of goals scored in that month. Your program keeps reading information till the user decides to stop.

Sample Run: Enter the month number: 3 Enter the scores: 2 Enter 'y' to continue or 'n' to stop: y Enter the month number: 2 Enter the scores: 1 Enter 'y' to continue or 'n' to stop: y Enter the month number: 0 Enter the scores: 4 Enter 'y' to continue or 'n' to stop: n Your team played 3 game(s) Your team scored maximum goals on January

Reference no: EM13934145

Questions Cloud

Method of cleansing and sterilization : Explain the reasons for an effective infection control policy and discuss whether the current method of cleansing and sterilization should be favored over the use of disposable instruments.
Why should people have less of appetite for sweets : Why should people have less of an appetite for sweets when they are stressed? Assistances supporting a possible explanation for this phenomenon, as well as gender differences in taste sensitivity, are explored.
Keeping accurate confidential patient records : The leakage of such sensitive information of the patient may even damage the status and reputation of the medical institution and the involved medical professionals.
How story of standard oil illustrate limit of business power : How does the story of Standard Oil illustrate the limits of business power? Does it better illustrate the dominance theory or the pluralist theory discussed in the chapter
Write a program in which you create an array of size twelve : Write a program in which you create an array of size 12 having all its elements initialized to -1. Then ask the user to enter a month number and the number of goals scored in that month.
Should you report him to your boss : What is your obligation here? Should you report him to your boss?
Discuss various approaches to stress management organization : Discuss the various approaches to stress management an organization might institute and evaluate their merit.
Protocols and their performance evaluation methodologies : "Wireless Sensor Networks: A survey of cross-layer MAC and Routing protocols and their performance evaluation methodologies" It is a literature review topicRegardless of the topic chosen, you need to demonstrate a sound knowledge and understanding..
Describe the participants involved : describe the participants involved Who were they? Where were they? Were they depressed persons from Canada?  (2) Describe the research method used; did they use an inventory, did they observe the participants etc.  (3) Lastly, summarize the results.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Diagram of a telephone network

Consider a diagram of a telephone network, which is a graph G whose vertices represent switching centers, and whose edges represent communication lines joining pairs of centers. Edges are marked by their bandwidth, and the bandwidth of a path is the ..

  Prepare a recursive linear-time algorithm

Prepare a recursive linear-time algorithm that tests whether a binary tree satisfies the search tree order property at every node.

  What is the linear data structure

what is the linear data structure ? Give example .Describe how an array is represented.

  Write a reference-based implementation of a queue

Write a reference-based implementation of a queue that uses a linear linked list to represent the items in the queue. You will need both a head reference and a tail reference.

  Ease of changes in the processing algorithms

Ease of changes in the processing algorithms: For example, line shifting can be performed on each line as it is read from the input device, on all the lines after they have been read, or on demand when the alphabetization requires a new set of shi..

  Create a flowchart that programs a robot to recognize

Create a flowchart that programs a robot to recognize how many playing cards you have and to put them in order from smallest to largest

  What do you mean by query tree what is meant by the

question 1 how does a query tree represent a relational algebra expression?question 2 what is query tree? what is meant

  Virtualization & memory

Evaluate the efficiency and reliability of both the most common nonpreemptive dispatch algorithms and the most common preemptive dispatch algorithms used for scheduling decisions. Provide one (1) example of the best use for each dispatch algorithm..

  How to use depth-first search to find out in time

Illustrate how to use depth-first search to find out in time O(|E|+|V |) whether undirected graph is 2-colorable. Describe and explain your strategy.

  If you can monitor when sql injections are performed on an

if you can monitor when sql injections are performed on an sql database what would you recommend as a security

  What is a control statement there are several types of

control statementswhat is a control statement? there are several types of control statements define two control

  Created a linked list class

created a linkedlist class

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd