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
50POINTS
maxonik [38]

Answer:

Ensure that all material and energy inputs and outputs are as inherently safe and benign as possible. Minimize the depletion of natural resources. Prevent waste. Develop and apply engineering solutions while being cognizant of local geography, aspirations, and cultures.Green engineering is the design, commercialization, and use of processes and products that minimize pollution, promote sustainability, and protect human health without sacrificing economic viability and efficiency.The goal of environmental engineering is to ensure that societal development and the use of water, land and air resources are sustainable. This goal is achieved by managing these resources so that environmental pollution and degradation is minimized.

Explanation:i helped

7 0
3 years ago
Read 2 more answers
Which of the following best reflects a shield system?
Dafna11 [192]
C, because a narrow structure evacuation below surface ground isn’t the best and a structure holding forces and isn’t to do with the question at all and d doesn’t matter if there include away or not
8 0
3 years ago
An inductor and resistor are connected in parallel to a 120-V, 60-Hz line. The resistor has a resistance of 50 ohms, and the ind
BARSIC [14]

Answer:

hi

Explanation:

the answer would be I dont know

6 0
3 years ago
If he wants to keep the height the same, what could the other dimensions be for him to get the volume he wants?
Fiesta28 [93]

tbm queria saber essa pergunta

8 0
3 years ago
In a 5V system if you were asked to take one input HIGH and another LOW what would you do (i.e. where would you connect them)?
dangina [55]

Answer:

HIGH from the supply voltage

LOW from ground

Explanation:

The answer depends on the kind of system and the purpose of the signal. But for practical reasons, in a DIGITAL system where 5V is HIGH and 0 V is LOW, 5 volts can be taken from the supply voltage (usually the same as high,  BUT must be verified), and the LOW signal from ground.

If the user has a multimeter, it must be set to continuous voltage on 0 to 20 V range.  Then place the probe in the ground of the circuit (must be a big copper area). Finally  leave one probe in the circuit ground and place the other probe in some test points to identify 5 v.

4 0
3 years ago
Other questions:
  • 1. Computers are fully digital which means: A. They can’t convert things from analog B. They work only with numeric digits (base
    6·1 answer
  • The dry unit weight of a soil sample is 14.8 kN/m3.
    12·1 answer
  • A piston–cylinder device contains a mixture of 0.5 kg of H2 and 1.2 kg of N2 at 100 kPa and 300 K. Heat is now transferred to th
    8·1 answer
  • What is electromagnetic induction?
    14·1 answer
  • You work in a furniture store. You receive a
    13·2 answers
  • A triangular plate with a base 5 ft and altitude 3 ft is submerged vertically in water. If the base is in the surface of water,
    13·1 answer
  • Match the scenario to the related government program.
    8·1 answer
  • A bronze bushing 60 mm in outer diameter and 40 mm in inner diameter is to be pressed into a hollow steel cylinder of 120-mm out
    8·1 answer
  • Please help been stuck on this for a couple minutes
    5·1 answer
  • Ferroconcrete is reinforced concrete that combines concrete and ________. A. Lead c. Copper b. Iron d. Aluminum.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!