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]
3 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]3 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
Vehicles begin arriving at an amusement park 1 hour before the park opens, at a rale of four vehicles per minute. The gale to th
Alina [70]

Answer:

a) ≈ 30 mins

b) 8 vpm

Explanation:

<u>a) Determine how long after the first vehicle arrival will the queue dissipate</u>

The time after the arrival of the first vehicle for the queue to dissipate

= 29.9 mins ≈ 30 mins

<u>b) Determine the average service rate at the parking lot gate </u>

U = A / t

where : A = 240 vehicles , t = 30

U = 240 / 30 = 8 Vpm

attached below is a detailed solution of the given problems above

3 0
3 years ago
Resolver em c as equações:<br><br> Z elevado à 2 igual a 3+4i
Marrrta [24]

Answer:

Quando um (ou todos) os outros coeficientes de uma equação do segundo grau são iguais a zero, essa equação é chamada incompleta. Neste artigo, analisaremos os métodos que podem ser usados para resolver equações incompletas, no caso em que o coeficiente C = 0, ou seja, o coeficiente é nulo.

Explanation:

Um lado da equação será a potência e outro, o número inteiro. De outro modo, transforme a equação deixando-a isolada em um dos lados. Reescreva a equação. Prepare-a a fim de extrair o logaritmo de ambos os lados, que é o inverso da potência. Você pode calcular o logaritmo de base.

3 0
3 years ago
A rigid bar ABCD is pinned at A and supported by two steel rods connected at B and C, as shown. There is no strain in the vertic
mylen [45]

Answer:

See attached picture.

Explanation:

4 0
3 years ago
16. Which polymers are recyclable?
MrRissso [65]

Answer:

Number 2 is HDPE, or High-Density Polyethylene. It is most commonly found in plastic bags, oil and detergent bottles, and toys. It is one of the simplest polymers to recycle. It is broken down into flakes, decontaminated and then reused for pipes, flower pots or reused as (non-food) bottles.

8 0
3 years ago
Briggs &amp; Stratton engines feature both a pressure lubrication and a pressure filtration system. Which statement is true?
Andreyy89
Answer would be Letter B
7 0
3 years ago
Other questions:
  • Determine the required dimensions of a column with a square cross section to carry an axial compressive load of 6500 lb if its l
    13·2 answers
  • The Release Train Engineer is a servant leader who displays which two actions or behaviors?
    6·1 answer
  • A cubical picnic chest of length 0.5 m, constructed of sheet styrofoam of thickness 0.025 m, contains ice at 0\[Degree]C. The th
    11·1 answer
  • A fire nozzle is coupled to the end of a hose with inside diameter D = 77 mm. The nozzle is smoothly contoured and its outlet di
    7·1 answer
  • Problem 1. Network-Flow Programming (25pt) A given merchandise must be transported at a minimum total cost between two origins (
    15·1 answer
  • A coil having a resistance of 10 ohms and an inductance of 4 H is switched across a 20W dc source. Calculate (a) time required b
    9·1 answer
  • You are to design the control for an automatic candy vending machine. The candy bars inside the machine cost 25 cents, and the m
    13·1 answer
  • Can you answer it ????,(^^)​
    12·2 answers
  • How to prepare the tools and materials for electric wiring?​
    14·1 answer
  • “We have to redo the deck we built last week,” Bennett tells his coworkers. “I just tested it, and it doesn’t hold the minimum w
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!