I need help with a C Programming question. All explanations and answers will be used to help me learn.
at 10:00 , 9 hours from now you will be sent questions and writing algorithms with a flowchart for it, for C++ in specific i would like it answered as soon as possible. i have uploaded files that will help understand the type of questions it is and how to answer it.
Lab1. ALGORITHMS
Exercise1
Design an algorithm and draw the corresponding flowchart for finding the sum of all whole numbers between 1 and 10 inclusive.
Exercise 2
Write an algorithm and the corresponding flowchart that does the following:
- It asks the user to enter a positive integer with 2 digits.
- If the entered number is out of range, the message “Too difficult!” is printed and the program terminates.
- Otherwise the program prints the sum of the two digits in the number that was entered. (use the integer division)
Exercise 3. Write an algorithm that presents the user with a choice of 2 beverages: Lemonade and Water. Then allows the user to choose a beverage by entering a number 1-2. Output which beverage they chose. Alter your algorithm to output "Error. Choice was not valid, here is your money back."? If the user enters any other input. Allow the user to repeat the process as much as he/she wants.
Exercise 4. Create an algorithm to calculate the average weight in a family. You should get the number of people in the family from the user and the individual weight for each member.
- - If the average weight of the family members is between 90 and 100 Kg, you program should print "You should go on diet".
- - If the average weight of the family members is between 60 and 80 Kg, you program should print
“Very good weight control"
- -Otherwise the program should print, “This family should visit a nutritionist for advice". Here is a sample screen output:
Exercise 5. Q. Write a pseudocode of an algorithm to print all the numbers between 0 and 99. (Hint: use While loop)
Exercise 6. Write a pseudocode to print the number and its square for all the numbers between 1 and 20(Hint: use While loop)
Exercise 7. Write an algorithm to score the paper-rock-scissor game. Each of the two users types in either P, R, or S. The program then announces the winner as well as the basis for determining the winner: Paper covers rock, Rock breaks scissors, Scissors cut paper, or Nobody wins. Be sure to allow the users to use lowercase as well as uppercase letters. Your program should include a loop that lets the user play again until the user says she or he is done. (Hint: use Do-While loop)
Write the algorithm and draw the flowchart for the following questions:
- Create an algorithm to compute the final price of an item given the original price and the quantity and assuming that the sales tax is 10%. Allow the user to repeat this calculation as much as he wants.
- Create an algorithm that computes the quiz average for all students in a class. The input of the algorithm would be the size of the class and the grades of all quizzes. The output would be the average quiz grade for the entire class (hint: you need to use iteration)
- Write an algorithm to find the largest number between 3 numbers.
- Write an algorithm to ask the user to enter a number, then calculate and print the sum of all even numbers starting from 0 to that number. Allow the user to repeat this operation as much as he wants.