1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
liraira [26]
2 years ago
8

CPS 2231: Computer Organization and Programming Programming assignment #1 Concepts: Scanner, loops, input validation, array, met

hods Point value: 100 points Due date: as noted on blackboard Assignment: Write a program that asks the user to enter today’s sales for five stores. The program should then display a bar chart comparing each store’s sales. Create each bar in the bar chart by displaying a row or asterisks. Each asterisk should represent $100 of sales. You must use a loop to print the bar chart. If the user enters a negative value for the sales amount, the program will keep asking the user to enter the sales amount until a positive amount is entered
Engineering
1 answer:
agasfer [191]2 years ago
3 0

Answer:

import java.util.*;

public class BarChart

{

public static void main(String args[])

{

int arr[]=new int[5];

Scanner sc=new Scanner(System.in);

for(int i=0;i<5;i++)

{

while(true){

System.out.println("Enter today's sale for store "+(i+1)+" (negative value not allowed)");

arr[i]=sc.nextInt();  

if(arr[i]>0)

break;

}

}

System.out.println("SALES BAR CHART");

for(int i=0;i<5;i++)

{

System.out.println("Store "+(i+1)+": ");

for(int j=0;j<arr[i];j=j+100)

{  

System.out.print("*");

}

System.out.println("");

}

}

}

You might be interested in
B. Is the “Loading Time” of any online application a functional or a non-functional requirement? Can the requirement engineers s
Oksi-84 [34.3K]

Answer:

non-functional requirement,

Yes they can.

The application loading time is determined by testing system under various scenarios

Explanation:

non-functional requirement are requirements needed to justify application behavior.

functional requirements are requirements needed to justify what the application will do.

The loading time can be stated with some accuracy level after testing the system.

4 0
2 years ago
Affect the amount and rate the alcohol reaches the<br> bloodstream.
just olya [345]

Answer:

Answer to the following question is as follows;

Explanation:

The amount of alcohol consumption can be influenced by a variety of things, including food.

The proportion and pace at which alcohol reaches the circulation is affected by drinking rate, body mass, and the size of the beverage. Alcohol enters your system as soon as it reaches that first sip, as per the National Institute on Drug Abuse and Alcoholism. After 10 minutes, the results are noticeable.

6 0
3 years ago
Guys i need help and some ones please help me
Dmitriy789 [7]

Answer:

4. A series of steps engineers use to solve problems.

Explanation:

The process of engineering design is a sequence of procedures that engineers pursue to arrive at a solution to a specific problem. Most times the solution includes creating a product such as a computer code, which fulfills certain conditions or performs a function. If the project in-hand includes designing, constructing, and testing it, then engineers probably adopt the design process. Steps of the process include defining the problem, doing background research,  specifying requirements, brainstorming solutions, etc.

4 0
3 years ago
There is evidence that liquid water existed on Mars at some time in the past. What is the evidence found indicating the presence
Norma-Jean [14]
There mag be water on Mars but it’s not very easy to spot, but that is besides the point,

Mars is a smaller planet then Earth, thus it has less gravity, meaning when water evaporates into the atmosphere of the planet the water slowly escapes into space, so there is less and less water on the planet.

Hope this helps!
5 0
3 years ago
What are the main causes of injuries when using forklifts?
vagabundo [1.1K]

The forklift overturning is a very common way of getting injured from a forklift. Overturning the forklift means it tips over onto it's side due to the operator turning it too fast.

5 0
3 years ago
Other questions:
  • What are the three main areas of bioengineering?
    11·1 answer
  • A BS of 5.43 ft is taken on a level rod at a 120-ft distance, and a FS of 8.76 ft is taken on the rod held 1,100 feet away.(a) W
    6·1 answer
  • A cannon fires a ball vertically upward from the Earth’s surface. Which one of the following statements concerning the net force
    13·1 answer
  • Carnot heat engine A operates between 20ºC and 520ºC. Carnot heat engine B operates between 20ºC and 820ºC. Which Carnot heat en
    5·1 answer
  • Cool water at 15°C is throttled from 5(atm) to 1(atm), as in a kitchen faucet. What is the temperature change of the water? What
    7·1 answer
  • Please I need help!<br><br> I need 1,2,&amp;3 drawn with front top and side view. Please help asap
    6·1 answer
  • Please help been stuck on this for a couple minutes
    5·1 answer
  • Cual es la definición de la distribución de las instalaciones?
    13·2 answers
  • Which of the following is used in the electrical field?
    7·1 answer
  • Nonconductive safety shoes can be safely worn in a potentially explosive environment.
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!