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

  Program to prompt the user to enter a postfix expression

Write a program to prompt the user to enter a postfix expression. When the user presses enter, the stack based method for constructing expression trees will be executed.

  Decrypting the ciphertext to recover the plaintext

If you get ciphertext message YPHDCRPBEQTAA, decrypt to recover plaintext.

  You need to find the smallest array and see a segment fault

Write me a function that finds the smallest item in an ArrayBag (by reference) and returns true if the arrayBag is not empty and false otherwise.

  Write algorithm that describes how program is going to work

Prior to commencing coding, you need to plan what you're going to code. Write an algorithm that describes how your program is going to work and how it links together.

  Describe purpose of queue in breadth-first traversal

Describe the purpose of queue in breadth-first traversal? Assume you had function call displayAtDepthN, which when given tree and depth would display only nodes at that depth.

  Conduct time complexity analysis of the algorithm

Hand test your algorithm using your allocated 10-element long list of alphabetic charactersas an illustrative/working example (see the Data Set below),

  Design an algorithm that asks for the user for the number

Design an algorithm that asks for the user for the number of fixed-price items to order, adds sales tax and flat-rate shipping, and displays the result.

  Saving contents of the richtextbox by creating a program

Create the statements to save the contents of the RichTextBox named rtbCurrent. Show a SaveFileDialog named sfdCurrent to get the name of the document from the user.

  Method singleparent returns number of nodes in binary tree

Write a method singleParent, which returns number of nodes in a binary tree that have only one child.

  Illustrate how b-tree will expand

Illustrate how tree will expand (after inserting each Part#), and what the final tree would like. (b) Repeat item (a), but use a B-tree of order p = 4 instead of a B+-tree.

  Sketch portion of decision tree via quicksort to sort array

Suppose you are using quicksort to sort array A with 6 distinct elements a1, a2, ..., a6. Sketch portion of the decision tree which corresponds to th ordering a3

  Write algorithm which divides n objects of u into k clusters

Suggest the algorithm which divides n objects of U into k clusters, making use of MST of a graph. Give a simple argument of correctness and bound on the running time of the algorithm you are proposing.

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