126k views
1 vote
You must use at least two different arrays a character array to store the welcome message (note: when creating your flowchart you will need to declare this message with the string data type as a variable and assign the message). use the puts() function to display the message to the screen. an array with a float datatype to store the prices of the items prompt the user to enter how many items they have to total. use a for() statement to fill the array using the value the user entered as the end point of the loop. use an accumulating total statement to compute the total sales there is a constraint - if the price of any one item is greater than $10.00 it is considered invalid, you must use a repetitive statement to display a message and force the user to enter a value less than $10.00 you need to create a function to compute the final total using a sales tax of 6% (.06) review the output screenshot to see what should be displayed to the user after execution. submission instructions: upload the .c source file, a screenshot of the c output screen, and .fprg flowgorithm flowchart file for grading using the instructions down below.

User SirBT
by
8.4k points

1 Answer

2 votes

Final answer:

The answer is focused on programming in C, specifically on using arrays to store data, ensuring values meet a constraint (below $10.00), and calculating a final total including sales tax with a function.

Step-by-step explanation:

The student is tasked with creating a C program that involves working with arrays and basic arithmetic operations to compute total sales. The flow consists of accepting user input to fill a float array with item prices, ensuring that each price is less than $10.00, and then calculating the total sales including a 6% sales tax. A character array is used to display a welcome message, and the user is prompted to enter the number of items. The student should also write a function to calculate the final total with tax.

To solve this, one can start with initializing arrays, then use a loop to fill the float array with item prices, while checking for the price constraint. An accumulator is utilized to sum up the prices, and a function can be called to calculate the final sales total, including the sales tax. The puts() function is used to display the welcome message.

User Avani Khabiya
by
8.7k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.