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
Olin [163]
3 years ago
9

Write a java program that use multiple arrays This is a simple array program which does not use an "external class & demo pr

ogram" If you wish, you may break it down into methods, but that is not required. a. Set up 4 arrays which hold data about 6 items you want to sell: [make them up] int[ ] itemnum int[ ] quantity double[ ] price double[ ] sales b. Set up loops to load the itemnum, quantity and price arrays c. Set up another loop to calculate values for the sales array. [= price * quantity] d. Set up another loop to print the item number and sales amount for each transaction . e. Set up another loop to calculate the total sales of all 6 items f. print the total sales amount
Computers and Technology
1 answer:
ValentinkaMS [17]3 years ago
4 0

Answer:

Explanation:

import java.util.Array;

public class Items{

public static void main (String {} args){

// a. Set up 4 arrays which hold data about 6 items you want to sell

int [] itemnum = new int[](1,2,3,4,5,6);

int [] quantity = new int[](500,200,350,100,270,300);

double [] price = new double [](10000, 50000,30000, 22000, 26000,100200);

double[] sales = new double [6];

//b. Set up loops to load the itemnum, quantity and price arrays

for(int I=0;I<6;I++)

{

System.out.println("Item "+itemnum[I]);

System.out.println("Item "+quantity[I]);

System.out.println("Item "+price[I]);

}

//c. Set up another loop to calculate values for the sales array.

for(int j=0;j<6;j++)

{

sales[j] = quantity[j] * price[j];

}

//d. Set up another loop to print the item number and sales amount for each transaction

for(int k=0;k<6;k++)

{

System.out.println("Item Number "+itemnum[k]);

System.out.println("Sales Amount "sales[k]);

}

//e. Set up another loop to calculate the total sales of all 6 items

double totalsales = 0;

for(int l=0;l<6;l++)

{

totalsales+=sales[l];

}

//f. print the total sales amount

System.out.print("Total Sales: "+totalsales);

}

}

You might be interested in
Aurelia is designing a user interface for a new game app. Which of the following should she taken into consideration for the use
serious [3.7K]

Answer:

C

Explanation:

what types of loop will be used.

4 0
3 years ago
Your ipad has an application that will not stop running. what feature/tool can you use to stop it? kill treason task manager for
saveliy_v [14]

you could force quit

6 0
3 years ago
Read 2 more answers
Which of the following activities can cause data to be damaged or lost?
jekas [21]
Illegal access to a system
3 0
4 years ago
URGENT!!! Which file format is used mainly in the Microsoft Windows operating system?
zzz [600]

Answer:

C.   BMP

Explanation:

BMP is a simple bitmap image format developed by Microsoft and IBM.

It's used almost exclusively on the Microsoft Windows operating system these days, was used on OS/2.  It's the format the basic MS Paint program, that comes with Windows, edits its file in.

It's also a basic graphic format to use for programmers.

Of course GIF, PDF, TIFF and PNG are also used on Windows, as well as on most other operating system.

6 0
3 years ago
The creation of​ __________ with digital media allows for large quantities of numerical or textual data to be searched online by
ANEK [815]

Answer:

Option A- Reference materials

Explanation:

Reference Materials A digital reference library that provides more than 600 high-quality reference books from the world's leading publishers to be searched online by data points and trends

3 0
3 years ago
Read 2 more answers
Other questions:
  • Background Susan finished work on system architecture issues, and her system design specification was approved. Now she is ready
    15·1 answer
  • According to which virtue do you need to secure information by limiting computer access to authorized personnel only ?
    13·2 answers
  • When you align or size a group of selected controls, the changes are made relative to the
    14·1 answer
  • How has information technology made piracy possible
    11·1 answer
  • A social cause is: O A. when one person protests without the support of others. B. something that not many citizens think or car
    8·1 answer
  • 9.
    15·1 answer
  • What symbol do we use to denote a character?
    14·1 answer
  • Help please not trying to fail
    13·1 answer
  • Any my hero academia fans out there don't report at all just what more friends to
    14·2 answers
  • Which of these statements about digital media is NOT accurate?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!