Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

C++

1) Number Analysis Program

Write a program that asks the user for a file name. Assume the file contains a series of numbers, each written on a separate line. The program should read the contents of the file into an array and then display the following data:

  • The lowest number in the array
  • The highest number in the array
  • The total of the numbers in the array
  • The average of the numbers in the array

2) Monkey Business
A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3x5 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then it should create a report that includes the following information:
• Average amount of food eaten per day by the whole family of monkeys.
• The least amount of food eaten during the week by any one monkey.
• The greatest amount of food eaten during the week by any one monkey.
Input Validation: Do not accept negative numbers for pounds of food eaten.

 

3) Larger Than n
In a program, write a function that accepts three arguments: an array, the size of the array, and a number n . Assume that the array contains integers. The function should display all of the numbers in the array that are greater than the number n

 

4) Chips and Salsa
Write a program that lets a maker of chips and salsa keep track of sales for five different types of salsa: mild, medium, sweet, hot, and zesty. The program should use two parallel 5-element arrays: an array of strings that holds the five salsa names and an array of integers that holds the number of jars sold during the past month for each salsa type. The salsa names should be stored using an initialization list at the time the name array is created. The program should prompt the user to enter the number of jars sold for each type. Once this sales data has been entered, the program should produce a report that displays sales for each salsa type, total sales, and the names of the highest selling and lowest selling products.
Input Validation: Do not accept negative values for number of jars sold.

 

5) Largest/Smallest Array Values
Write a program that lets the user enter 10 values into an array. The program should then display the largest and smallest values stored in the array.

 

6)   2D Array Operations
Write a program that creates a two-dimensional array initialized with test data. Use any data type you wish. The program should have the following functions:
getTotal This function should accept a two-dimensional array as its argument and
return the total of all the values in the array.
getAverage This function should accept a two-dimensional array as its argument and return the average of all the values in the array.
getRowTotal This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the subscript of a row in the array. The function should return the total of the values in the specified row.
getColumnTotal This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the
subscript of a column in the array. The function should return the total of the values in the specified column.
getHighestInRow This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the
subscript of a row in the array. The function should return the highest value in the specified row of the array.
getLowestInRow This function should accept a two-dimensional array as its first argument and an integer as its second argument. The second argument should be the
subscript of a row in the array. The function should return the lowest value in the specified row of the array.
Demonstrate each of the functions in this program.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91557904

Have any Question?


Related Questions in Computer Engineering

Write a c program please follow instructions exactly this

Write a C++ program. PLEASE FOLLOW INSTRUCTIONS EXACTLY. This program takes its inputs from a file that contains numbers. The program reads them in as type double. The program outputs to the screen the  standard deviatio ...

Sum of consecutive integersa write a program that prompts

Sum of consecutive integers A) Write a program that prompts for an integer-let's call it X-and then finds the sum of X consecutive integers starting at 1. That is, if X = 5, you will find the sum of1+2+3+4+5=15 B) Modify ...

Question monicas reading comprehension score 22nbspmean

Question: Monica's reading comprehension score = 22  Mean fourth grade reading comprehension score = 19  Standard deviation of the fourth grade's reading comprehension = 1.8  Monica's z-score in math = 2.2  Mean fourth g ...

Need help with the following 2 problems1 they offer you a

Need help with the following 2 problems: 1. They offer you a promissory note with a four-year maturity, which will generate $ 3,000 at the end of each of the four years. Its price is $ 10,200. What is the implicit annual ...

What are some examples of when a data compression utility

What are some examples of when a data compression utility can be used for information stored on a computer's hard drive?

Question suppose you are the analyst charged with

Question : Suppose you are the analyst charged with developing a new system to help senior managers make better strategic decisions. What methodology would you use? How would the business strategy affect your approach? W ...

Question the use of encryption can have adverse effects on

Question: The use of encryption can have adverse effects on incident response and incident investigations; however, from a security standpoint, encryption is a major component in network confidentiality. Present your arg ...

Search the web or other sources for a recursive function

Search the web or other sources for a recursive function that's not in our Python text. Implement that function in Python then turn in a Word document that contains the following: (1) A brief paragraph explaining what yo ...

We have seen that a block cipher such as aes is insecure if

We have seen that a Block cipher such as AES is insecure if an attacker can have a very large number of chosen plain-text messages (e.g.2 50 messages) for which he gets the corresponding cypher-text. Suppose that we cons ...

Answer the following question -whats the difference between

Answer the following Question : -What's the difference between Anthropomorphic design and Non anthropomorphic design -What are the speech and auditory devices ? -What's the synchronous distribution ?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As