A c++ program that analyzes a set of numbers can be very useful. Create an Analysis application that prompts the user for numbers in the range 1 through 50, terminated by a sentinel, and then performs the following analysis on the numbers:
• Determine the average number
• Determine the maximum number
• Determine the range (maximum – minimum)
• Determine the median (the number that occurs the most often)
Write a program that declare an array of size 25 consisting of students’ test scores in the range 0–200. The user may input any score in the array. It should then determine the number of students having scores in each of the following ranges: 0–24, 25–49, 50–74, 75–99, 100–124, 125–149, 150–174, and 175–200. Output the score ranges and the number of students. (Run your program with the following input data: 76, 89, 150, 135, 200, 76, 12, 100, 150, 28, 178, 189, 167, 200, 175, 150, 87, 99, 129, 149, 176, 200, 87, 35, 157)
The maximum weight y (in pounds) for a man in the United States Marine Corps can be approximated by the mathematical model
y=0.040x2 −0.11x+3.9, 58≤x≤80
where x is the man’s height (in inches).
Design an algorithm and write a C++ program that prompts the user to input the height in inches. The program calculates and outputs the weight in pounds.
Imagine a publishing company that markets both book and audiocassette versions of its work. Create a class Publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: Book which adds page count (type int) and author (a string); and Tape which adds a playing time in minutes (type float). Each of these three classes should have a getData() function to get its data from the user at keyboard, and a putData() function to display its data. getData() and putData() should be overloaded in both derived class.
Add a member function having return type bool called isOversize() to the book and tape classes. Let’s say that a book with more than 800 pages, or a tape with a playing time longer than 90 minutes (which would require two cassettes), is considered oversize. You can access this function from main() and display the string “Oversize” for oversize books and tapes when you display their other data.
Consider an abstract class Computer having
· Two fields (i.e. companyName, price) and
· A single function named show()
A class named Desktop inherits Computer class and adds fields representing
· color, monitor size, and processor type and
· Override function named show() to display values of its all attributes
A class named Laptop inherits Computer class and adds fields representing
· color, size, weight, and processor type and
· Override function named show() to display values of its all attributes
Write a main() function that instantiates objects of derived classes to access respective show() function using pointer to Computer class (dynamic binding).
❑A parking garage charges a $2.00 minimum fee to park for up to three hours. The garage charges
an additional $0.50 per hour for each hour or part thereof in excess of three hours. The maximum
charge for any given 24-hour period is $10.00. Assume that no car parks for longer than 24 hours
at a time. Write a program that calculates and prints the parking charges for each of three
customers who parked their cars in this garage yesterday. You should enter the hours parked for
each customer.
❑Your program should print the results in a neat tabular format and should calculate and print the
total of yesterday’s receipts. The program should use the function calculateCharges to determine
the charge for each customer. Your outputs should appear in the following format:
Car parking tickets
EE204031 Object Oriented Programming 50
Car Hours Charge
1 1.5 2.00
2 4.0 2.50
3 24.0 10.00
TOTAL 29.5 14.50
you have to create a program that shall determine the age of the user.
Write a C++ program using a function to identify the smallest number from three numbers. Name the function as minval.
Sample Output:
Enter First Number: 300
Enter Second Number: 200
Enter Third Number: 1000
The Smallest Number: 200
You have to pile clothes in a box in such a
way that cloths can be added and removed
from only one end. Determine the most
suitable data structure. Provide both array
based and linked list based implementation.
Define a two dimensional array named temp of three rows and four columns of type int such that the first row is initialized to, 6,8,12,9; the second row is initialized to 17,5,10,6; and the third row is initialized to 14,13,16,20.