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
4. What are these parts commonly called?
patriot [66]

These parts are commonly called carburetor emulsion tubes. These tubes maintain the air-fuel ratio at different speeds.

The carburetor is a device of the combustion engine power supply system that mixes fuel and air in order to facilitate internal combustion.

The carburetor emulsion tubes are tubes that maintain the air-fuel ratio at different velocities.

These tubes (carburetor emulsion tubes) are small brass cylinders where the metering needle slides into them.

Learn more about carburetors here:

brainly.com/question/4237015

7 0
2 years ago
What are the atomic binding force and energy? how do they relate to materials strength and thermal stability.
Elanso [62]

Answer:

As we know that every molecule is attached by a strong force .The force required to disassemble the atoms is know as atomic binding force or we can say that the force required to disassemble the electron from atoms is known as binding force.On the other hand the energy require to doing this is known as atomic binding energy.

If the binding force is high then it will become difficult to disassemble thermally as well as mechanically.So we can say that it have direct relationship with   materials strength and thermal stability.

7 0
3 years ago
An insulated, vertical piston-cylinder device initially contains 10kg of water, 6kg of which is in the vapor phase. The mass of
Alexeev081 [22]

Answer:

a)120C

b)29kg

Explanation:

Hello!

To solve this exercise follow the steps below

1. we will call 1 the initial state, 2 the steam that enters and 3 the final state

2. We find the quality of the initial state, dividing the mass of steam by the total mass.

q1=\frac{6kg}{10kg} =0.6

3 Find the internal energy in the three states using thermodynamic tables

note:Through laboratory tests, thermodynamic tables were developed, these allow to know all the thermodynamic properties of a substance (entropy, enthalpy, pressure, specific volume, internal energy etc ..)  

through prior knowledge of two other properties such as pressure and temperature.  

u1=IntEnergy(Water;x=0,6(quality);P=200kPa) =1719KJ/kg

u2=IntEnergy(Water;t=350;P=5000kPa) =2808KJ/kg

u3=IntEnergy(Water;x=1;P=200kPa) =2529KJ/kg

4. use the internal energy and pressure to find the temperature in state 3, using thermodynamic tables

T3=Temperature(Water;P=200kPa;u=u3=2529KJ/kg)=120C

5. Use the first law of thermodynamics in the system, it states that the initial energy in a system must be equal to the final

m1u1+m2u2=(m1+m2)u3

where

m1=inital mass=10kg

m2=the mass of the steam that has entered.

solve for m2

(m1)(u1-u3)=(m2)(u3)-(m2)(u2)

m2=m1\frac{u1-u3}{u3-u2} =10\frac{1719-2529}{2529-2808} =29kg

7 0
3 years ago
THIS SIGN MEANS: A. The right lane will end ahead B. The highway will be divided ahead C. Less space between lanes ahead
hodyreva [135]
B.) the highway will be divided ahead
7 0
3 years ago
Who can use NIST resources?
sukhopar [10]

Answer:

Federal agencies

Explanation:

NIST (National Institute of Standards and Technology) also called between 1901 and 1988 National Bureau of Standards (NBS), it is an agency of the Technology Administration of the United States Department of Commerce. The mission of this institute is to promote innovation and industrial competition in the United States through advances in metrology, standards and technology in ways that improve economic stability and quality of life.

As part of this mission, NIST scientists and engineers continually refine the science of measurement (metrology) by creating precise engineering and manufacturing required for most current technological advances. They are also directly involved in the development and testing of standards made by the private sector and government agencies. The NIST was originally called the National Bureau of Standards (NBS), a name it had from 1901 to 1988. The progress and technological innovation of the United States depends on the abilities of the NIST, especially if we talk about four areas: biotechnology , nanotechnology, information technologies and advanced manufacturing.

7 0
3 years ago
Other questions:
  • the ____ method is the safest turning technique to use as it does not expose your hands to the airbags deployment area
    15·1 answer
  • 3- A cylinder with 0.4kg of Nitrogen gas at 27ºC keeps under pressure by a frictionless piston. Weight of this piston will incre
    6·1 answer
  • You want to know your grade in Computer Science, so write a program that continuously takes grades between 0 and 100 to standard
    7·1 answer
  • One kilogram of air, initially at 5 bar, 350 K, and 3 kg of carbon dioxide (CO2), initially at 2 bar, 450 K, are confined to opp
    14·1 answer
  • The MOST common injury causing absence from work is
    7·2 answers
  • I need help due today please help
    5·1 answer
  • The resistance of a copper wire 200 m long is 21 Q. If its thickness (diameter) is 0.44 mm, its specific resistance is around___
    11·1 answer
  • A TV USE 75 WATTS WHILE IN USED ASSMING THAT ITIS USED 4 HOURS EVERY DAY HOW MUCH ENERGY IN 4 IN KWH WOULD THE TV CONSUME ANNUAL
    13·2 answers
  • Travel Planning or Destination Planning will help make your travel more efficient, and not necessary a risk reduction plan as yo
    10·2 answers
  • If 200 amperes flow from the positive terminal of a battery and operate the starter motor, how many amperes will flow back to th
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!