Posted: December 6th, 2022

C ++ quiz | Computer Science homework help

C ++ Quiz.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

 

You should use simple control structures (such as sequence, selection, iteration, do or while, e.t.c) and functions.

 

1A) Write a program that will loop continuously to get user input of positive numbers and total them out. The loop will only stop when the user enters non-positive numbers (including zero). The program will display the average before it ends.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

 

 

B) Write a program that will randomly generate a number from 1 to 100. The user will then guess the number via several attempts. Each time the guess is wrong, the program will let the user know if it is higher or lower than the number. If the number guessed is correct, it will print “Bingo!” and quit the program.

 

C) Write a program that asks user to type of series of positive integers. When the user types a negative value, the program should display error message and ask for another value. If the user types 0, it means that the series has end and the program should display the average of all the positive values provided. If the number of typed values is zero, the program writes “No Average”.

 

D) Write a program to request the user to input a numeric value. If the input is even, the program will display all the even numbers from 2 until the input. If the number is odd, the program will display all the odd numbers from 1 until the input.

 

E) A laundry shop charges its customer RM5, for every kilo of laundry. Write a program that asks for the laundry weight and if ironing is wanted. For every kilo, RM7 is charged for iron. Display the total price including ironing cost.

 

F) Write a function named shift that receives an array of 10 integers, one integer at the index location, shifting each array item to the right and eliminate the last item. The function must then display the final array content.

2) Write a program using struct that calculates the sales of items in a store. The program must have a function that works with struct.

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
error: Content is protected !!
Open chat
1
Order through WhatsApp!
professionalsessays.com
Hello!
You Can Now Place your Order through WhatsApp
 

 

Order your essay today and save 15% with the discount code 2023DISCOUNT