Write a program using a Loop structure that takes Five inputs of sales for item 1 - item 5 from the use during runtime. The program should use Running -Total to calculate the sales. o The program should apply 6% Sales Tax. o The program should give a discount of 4% if the total sales is greater than $5000. o The program should give a discount of 5% if the total sales is greater than $7000. o The program should validate the input as numbers only (Must Enter a Number). The output of the program should be as follow: Provide different outputs to cover (1-6). 1. The five items entered for sales calculations. 2. The subtotal of sales without taxes. 3. The total sales with taxes. 4. The final total of no discount < $5000. 5. The final total of discount if sales > $5000. 6. The final total of discount if sales > $7000.
Types of Loop
Loops are the elements of programming in which a part of code is repeated a particular number of times. Loop executes the series of statements many times till the conditional statement becomes false.
Loops
Any task which is repeated more than one time is called a loop. Basically, loops can be divided into three types as while, do-while and for loop. There are so many programming languages like C, C++, JAVA, PYTHON, and many more where looping statements can be used for repetitive execution.
While Loop
Loop is a feature in the programming language. It helps us to execute a set of instructions regularly. The block of code executes until some conditions provided within that Loop are true.
Loop:-
A loop is a set of instructions that are repeatedly carried out in computer programming until a specific condition is met. Typically, a certain procedure, like getting and altering a piece of data, is carried out, and then a condition, like whether a counter has reached a specific number, is verified.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images