Write a program and flowchart. The program should ask the user how many customers they want to track. Then, it asks for customer numbers, and sales by customer. At the end, it prints out the customer number, the customer sales, and then the total sales and average sales.
Here is code:
#include <stdio.h>
int main()
{
int count = 0;
printf("Enter number of customers : ");
scanf("%d", &count);
int number[count];
float sales[count];
float total = 0, average;
int i = 0;
while (i < count)
{
printf("Enter number #%d : ", (i + 1));
scanf("%d", &number[i]);
printf("Enter sales #%d : ", (i + 1));
scanf("%f", &sales[i]);
total += sales[i];
i++;
}
average = total / count;
for (i = 0; i < count; i++)
{
printf("the number is %d\n", number[i]);
printf("the sales is %f\n\n", sales[i]);
}
printf("Total is : %f\n", total);
printf("Average is : %f\n", average);
return 0;
}
Output:

FlowChart:
![int count-O read count declare int number[count] float sales[count] float total -0, average int i 0 i < count alse True avera](http://img.homeworklib.com/images/1cb4560b-b52a-49df-ac4f-5aac3e02ef57.png?x-oss-process=image/resize,w_560)
Write a program and flowchart. The program should ask the user how many customers they want to track. Then, it asks for customer numbers, and sales by customer. At the end, it prints out the customer...
Write a program and flowchart. The program should ask the user how many customers they want to track. Then, it asks for customer numbers, and sales by customer. At the end, it prints out the customer number, the customer sales, and then the total sales and average sales. You must use two different arrays, one for customer number, and one for sales. These are, in effect, parallel arrays. You must use a "while" loop to gather customer number and sales....
write a program code that asks the user how many numbers they wish to find the statistics of and then asks the user to enter those numbers. The program must then calculate and display the average variance and standard deviation of the numbers entered by the user. the program code must -ask three user how many numbers they wish to find the statistics of -ask the user to enter those numbers and store them in an array - use a...
Write a program that calculates the average of a stream of non-negative numbers. The user can enter as many non-negative numbers as they want, and they will indicate that they are finished by entering a negative number. For this program, zero counts as a number that goes into the average. Of course, the negative number should not be part of the average (and, for this program, the average of 0 numbers is 0). You must use a method to read...
C++
Write a program that asks for a number and then prints as many
lines as the user inputs. Each line contains as many pairs of
characters ("*#") as the number of this line. It should look like
the right half of a pyramid. Your version of the program must print
the same result as the expected output. To to this lab, you must
use two do-while loops.
Two exceptions:
When the user inputs a number less than 1, then...
Write a small program that asks the user how many asterisks it should print out. The user responds with a number, then the program prints that number of asterisks. The number of asterisks to print should be stored in a variable. Finally the program asks the user if it should start over, and repeats as many times as the user wants. The prompt to run the program again should look like the one below, and should wait at the end...
Use PYTHON3 to create a program that asks the user for their name, and then prints their initials. You must create a function called getInitials() that takes the name string and prints out the initials. It must be case insensitive and the initials must be printed in upper case. The program must contain a main() and a function called getInitials(), implemented as described in the function header comment given below. (You should include this function header comment in your own...
Ask the user to enter a message Ask the user how many time they want to print the message Then use "while","do-while" and "for" loop to print the message. Show the number at the beginning of the lines when printing. For example: Enter your message: Welcome to Java How many time you want to print this message: 3 Using "while" loop: 1=> Welcome to Java 2=> Welcome to Java 3=> Welcome to Java Using "do-while" loop: 1=> Welcome to Java...
Write a Program that has a menu with a layout below, that asks the user if they want to: 1. Converts from feet and inches to meter and centimeters 2. Converts from meter and centimeters to feet and inches 3. Quit the program The program should continue as long as the user asks it to. The program will use a switch statement for the menu option selection. Either a do loo or a do-while loop can be used for the overall...
Write a program that asks the user for a negative number, then prints out the product of all the numbers from -1 to that number Enter a negative number: -6 720 (The answer is 720 because-1x-2x-3x-4x-5 x-6 720).
Write a C++ program that asks user number of students in a class and their names. Number of students are limited to 100 maximum. Then, it will ask for 3 test scores of each student. The program will calculate the average of test scores for each student and display with their names. Then, it will sort the averages in descending order and display the sorted list with students’ names and ranking. Follow the Steps Below Save the project as A4_StudentRanking_yourname....