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
A global resources company uses data-intensive, cloud-based simulation software, but users in remote locations find that the res
lakkis [162]

The type of technology illustrated in the given example is called; Edge Computing

We are told that;

- Company uses data-intensive, cloud-based simulation software

- Company decides to deploy multiple instances of the application in locations closer to the end users due to the fact that users in remote locations complained of lack of responsiveness.

  • Now, the type of technology illustrated from the solution the company is trying to perform is called Edge Computing.

  • This is because Edge Computing fundamentally is a type of technology that is used to bring computation and data storage closer to the user devices that collects them instead of depending on a central location that may be thousands of kilometers away.

Now, the edge computing technology is usually done to ensure that real-time data does not suffer from latency issues that can affect the performance of applications.

Read more on edge computing at;brainly.com/question/23858023

6 0
2 years ago
2. How were scientists able to access a car's computer system?
cupoosta [38]
Ans:

2. The wireless hacking was done by taking advantage of the sensors inside each tire that broadcast a brief radio signal every 60 to 90 seconds. The signal tells one of the car's computer systems the pressure of each.

7 0
3 years ago
In a fluid power system, if energy is not transferred to work, what form does it take?
Artyom0805 [142]

Answer:

I think its heat but im not sure

Explanation:

7 0
3 years ago
The engine of a 2000kg car has a power rating of 75kW. How long would it take (seconds) to accelerate from rest to 100 km/hr at
Delvig [45]

Answer: 10.29 sec.

Explanation:

Neglecting drag and friction, and at road level , the energy developed during the time the car is accelerating, is equal to the change in kinetic energy.

If the car starts from rest, this means the following:

ΔK = 1/2 m*vf ²

As Power (by definition) is equal to Energy/Time= 75000 W= 75000 N.m/seg, in order to get time in seconds, we need to convert 100 km/h to m/sec first:

100 (Km/h)*( 1000m /1 Km)*(3600 sec/1 h)= 27,78 m/sec

Now, we calculate the change in energy:

ΔK= 1/2*2000 Kg. (27,78)² m²/sec²= 771,728 J

<h2>If P= ΔK/Δt, </h2><h2>Δt= ΔK/P= 771,728 J / 75,000 J/sec= 10.29 sec.</h2>
4 0
3 years ago
Rotating magnetic field inside a set of conducting wires is a simple description of a what
Advocard [28]

Answer:

hii there

It is called an electromagnet. The strength of the magnetic field produced is determined by the amount of current passing through the conductor. The rotating magnetic field is the rotor and the windings in which current is produced are in the fixed stator.

Explanation:

hope it helps

have a nice day : )

5 0
2 years ago
Other questions:
  • The y-component of velocity for a certain 2-D flow field is given as u = 3xy + x2 . Determine the x-component of velocity if the
    12·1 answer
  • Two kilograms of air in a piston-cylinder assembly undergoes an isothermal process from an initial state of 200K, 300kPa to 600k
    8·1 answer
  • A kite is an airfoil that uses the wind to produce a lift. Held in place by a string, a kite can remain aloft indefinitely. The
    9·1 answer
  • A block of mass M rests on a block of mass M1 = 5.00 kg which is on a tabletop. A light string passes over a frictionless peg an
    14·1 answer
  • Heat is applied to a rigid tank containing water initially at 200C, with a quality of 0.25, until the pressure reaches 8 MPa. De
    8·1 answer
  • Drag each label to the correct location on the image.
    5·2 answers
  • Special certification is required for technicians who handle which of the following systems?
    10·1 answer
  • Drop the name below the corresponding part. (Look at the picture above to answer)
    5·1 answer
  • What happens if you leave your car on while pumping gas
    8·1 answer
  • "Transformer is used to change the voltage".
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!