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
Alenkinab [10]
3 years ago
5

• Open your Netbeans IDE and answer the following question

Computers and Technology
1 answer:
VARVARA [1.3K]3 years ago
8 0

Answer:

public static void main(String[] args)

   {

       int cdCount;

       double cdCountAfterDiscount;

       DecimalFormat df = new DecimalFormat("$##.##"); // Create a Decimal Formatter for price after discount

       System.out.println("Enter the amount of CD's bought");

       Scanner cdInput = new Scanner(System.in);  // Create a Scanner object

       cdCount = Integer.parseInt(cdInput.nextLine());  // Read user input

       System.out.println("CD Count is: " + cdCount);  // Output user input

       if(cdCount <= 14 )

       {

           System.out.println("There is no discount");

           System.out.println("The final price is " + cdCount*3.5);

       }

       if(cdCount >= 15 && cdCount<=50)

       {

           System.out.println("You have a 1% discount.");

           cdCountAfterDiscount = (cdCount *3.5)-(3.5*.01);

           System.out.println("The final price is " + df.format(cdCountAfterDiscount));

       }

       if(cdCount >= 51 && cdCount<120)

       {

           System.out.println("You have a 5% discount.");

           cdCountAfterDiscount = (cdCount *3.5)-(3.5*.05);

           System.out.println("The final price is " + df.format(cdCountAfterDiscount));

       }

       if(cdCount >= 120)

       {

           System.out.println("You have a 10% discount.");

           cdCountAfterDiscount = (cdCount *3.5)-(3.5*.1);

           System.out.println("The final price is " + df.format(cdCountAfterDiscount));

       }

   }

You might be interested in
2.Write an if /else if statement that carries out the following logic. If the value of variable quantityOnHand is equal to 0, di
Oliga [24]

Answer:

if(quantityOnHand == 0) { cout<<"Out of stock"; }

else if(quantityOnHand > 0 && quantityOnHand <10) { cout<<"Reorder "; }

else if(quantityOnHand >= 10){ }

See Explanation for comments

Explanation:

//This program segment is written in C++

//Only required segment is written

// Comments are used for explanatory purpose

// Program Segment starts here

/*

The following condition tests if quantityOnHand equals 0

If this condition is true, the program prints "Out of stock" without the quotes

*/

if(quantityOnHand == 0) { cout<<"Out of stock"; }

/*

The following condition tests if quantityOnHand  is greater than 0, but less than 10

If this condition is true, the program prints "Reorder " without the quotes

*/

else if(quantityOnHand > 0 && quantityOnHand <10) { cout<<"Reorder "; }

/*

The following condition tests if quantityOnHand  is greater than o equal to 10

If this condition is true, nothing is done

*/

else if(quantityOnHand >= 10){ }

// End of program segment

Assumption: <em>The program assumes that variable </em>quantityOnHand has already been declared

5 0
4 years ago
A short story, but i remember in 1nd - 5th grade at my elementary school here is the list from first to last for being cool at s
Evgen [1.6K]

We all live similar lives don't we.

3 0
3 years ago
Read 2 more answers
Write the definition of a function named max that receives an int parameter and returns the largest value that it has been calle
kkurt [141]

Answer:

Following are the code in the C language .

int max(int x) // function definition

{

static int largest=0; // variable declaration

if (x>largest) // checking the condition

largest=x; // assign the value of input in the largest variable

return largest; // return the largest number

}

Explanation:

Following are the description of code .

  • Decalred a function max of int type which hold a parameter x of int datatype.
  • In this function compared the number x with the largest .If this condition is true then largest number hold the value of x variable
  • Finally return the largest number .
8 0
3 years ago
During an engine's intake stage, what passages inside the cylinder head of a gasoline powered engine must the incoming air-and-f
kow [346]
The intake ports must be open to allow fuel and oxygen to enter cylinder, then closes during compression. Your answer is A.
3 0
3 years ago
There is one clear definition of IT. True False
Elenna [48]

Answer:

That is False. it has more definitions not only one.

8 0
3 years ago
Other questions:
  • The logical view Select one: a. shows how data are organized and structured on the storage media. b. presents an entry screen to
    7·1 answer
  • Hey im trying to get a refund because i got charged 24$ for the yearly plan and i didnt know i would get charged can i get the y
    11·1 answer
  • What specific database stores local user accounts on local computers, and allows users to sign in to and access resources only o
    9·1 answer
  • To use an imported image, simply drag it from the desktop onto the stage. true or false
    15·2 answers
  • Which kind of testing runs the system in a simulated environment using simulated data?a) validation testing. b) verification tes
    5·1 answer
  • A buffer is filled over a single input channel and emptied by a single channel with a capacity of 64 kbps. Measurements are take
    11·1 answer
  • True or false = the order of cannot be changed in slide shorter view ,true or false =menu bar is located just below the title ba
    8·2 answers
  • Edhesive assignment 1 movie ratings
    9·1 answer
  • A search engine finds bugs and system failures in your computer.<br><br> True or False?
    7·2 answers
  • Complex scientific research is usually done using?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!