Question
Need help with my Questions) If at first you don't succeed, call it version 1.0. - Unknown Lab 7 Instructor-assigned problem: Question 1. You must
Need help with my Questions)
"If at first you don't succeed, call it version 1.0." - Unknown
Lab 7
Instructor-assigned problem: Question 1.
You must choose a second problem to also submit a solution for.
Submit two .cpp files to Blackboard under Lab 07.
Follow this formatting for your .cpp file names: LastNameFirstName_Lab#.Question#.cpp
Example: SchleyRebecca_7.1.cpp 1. Write a program that does the following: Ask the user to enter the price of their items. The user can enter as many items as they want until the user enters the integer 0. Print out the total of their checkout. If the sum is greater than $100, print out "That's expensive!" Sample run of program: Enter the price of an item:
> 27
Enter the price of an item:
> 80Enter the price of an item:
> 0
Your checkout total is $107.
That's expensive! 2. Write a program that prompts the user for a positive integer. Validate the input and do not accept a negative number. Use a while loop to find the sum of all odd digits of the number. Sample run of program: Enter a positive integer:
> -237
Invalid input! Try again:
> 237
The sum of the odd digits in the number is 10. 3. Write a program that reads in a sequence of integer inputs between 1 and 100 (using a while loop) until the user enters 0. At that point the program prints the counts of even and odd integers the user entered. Sample run of program: Enter a number:
> 23
Enter a number:
> 15
Enter a number:
> 12
Enter a number:
> 34
Enter a number:
> 9
Enter a number:
> 0
Number of even integers: 2
Number of odd integers: 3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started