I need help with this program. I need code for this . Java if statements Determine the amount of discount a person should receive. If the bill is more than 2000, then the person should receive a 15% discount. If the bill is 2000 dollars or less, the person does not receive a discount of any kind. Sample Data: 500 2500 4000 333.33 95874.2154 Sample Output= Enter the original bill amount :: 500 Bill after discount :: 500.00 Enter the original bill amount :: 2500 Bill after discount :: 2125.00 Enter the original bill amount :: 4000 Bill after discount :: 3400.00 Enter the original bill amount :: 333.333 Bill after discount :: 333.33 Enter the original bill amount :: 95874.2154 Bill after discount :: 81493.08

Answers

Answer 1

Answer:

The program in Java is as follows:

import java.util.Scanner;

public class MyClass {

   public static void main(String args[]) {

     double bill;

     Scanner input = new Scanner(System.in);

     System.out.print("Enter the original bill amount : ");

     bill = input.nextDouble();      

     if(bill>2000){

         bill-=0.15*bill;

     }

     System.out.println("Bill after discount: " + bill);

   }

}

Explanation:

This declares bill as double

     double bill;

This lets the program accept input

     Scanner input = new Scanner(System.in);

This prompts user for the original bill amount

     System.out.print("Enter the original bill amount : ");

This gets the bill from the user

     bill = input.nextDouble();      

This checks if the input bill is greater than 2000

     if(bill>2000){

If yes, the bill after discount is calculated as follows:

         bill-=0.15*bill;

     }

This prints the bill after discount

     System.out.println("Bill after discount: " + bill);


Related Questions

NEED ASAP.


Which multimedia feature can be used to automatically move objects in your slides?
X transition
O animation
O clipart
O innovation

Answers

Animationnnnnnnnnnnnn
Animation or clip art!!

What are the 5 characteristics of flowchart

Answers

Answer:

Here's ur answer

Explanation:

(i) Should consist of standardized and acceptable symbols. (ii) The symbols should be correctly used according to flowcharts rules. (iii) Should have short, clear and readable statements written inside the symbols. (iv) It must have clear one starting point and one ending point.

How important is the knowledge of ICT to a pupil like you?

Answers

For me it is not important

Which of the following is NOT a peripheral?
Keyboard
USB storage drive
Printer
CPU

Answers

USB is the answer to your question
a CPU is NOT a peripheral device because a computer system cannot work without a CPU.
A peripheral device is used to put information into and get information out of the computer.

Giving 5 stars, a Thanks, 80 points, and Branliest to whoever answers them correctly.
What refers to how a game’s player shapes what happens in their own personal game experience by making choices on how they play?
Group of answer choices

pseudostory

metagame

ludonarrative

iambic pentameter

Answers

Answer:

Explanation:

The answer is ludonarrative.

Please mark me brainliest.

Use the drop-down menus to complete the steps to open the Lookup Wizard.

1. Open the table in ___
view.

2. Click in the ___
column of the desired field.

3. Click the ___
, and then click Lookup Wizard.

Answers

Answer: 1. design view 2. data type 3. arrow

Explanation:

I just did it :)

1 point
Which of the following best describes the purpose of a design
specification?
help plssss!

Answers

...You didn’t say what the choices are

Anyone recommend any underrated kpop songs? I'm mostly into girl group songs, but I'd be nice to listen to a boy group song for once lol.

When I say underrated please don't put songs with more than 30 million streams lol.

Songs I recommend:

Loona/Cherry-Love Cherry Motion
Loona/ViVi-Everyday I Love You
Binu-Bibi
BIYA- COTAI
Luri- Blah Blah
Nature- OOPSIE
Nature- Girls
fromis_9- Heart to Heart
fromis_9- DKDK

There's so much more, buy my brain just stopped working

Answers

Answer:

Omona - Mixnine.

Highlight - Iz*one.

Downpour - IOI.

Goodbye - 2NE1.

Lonely - Sistar.

Stylish - Loona.

Satellite - Loona.

Twilight - Kim Lip.

Explanation:

Answer:

NCT127 /STCKER

Explanation:

Three different numbers need to be placed in order from least to greatest. For example, if the numbers are ordered 9, 16, 4, they should be reordered as 4, 9, 16. Which of the following algorithms can be used to place any three numbers in the correct order?

Answers

Answer:

what are the three different numbers?

Describe advantages and disadvantages for microprocessor controlled devices in the household.
(4) point form pls

Answers

1.Easier actions 2.Time saving 3.Money saving 4.Energy saving

QBasic commands any 10 with examples

Answers

Answer:

I haven't used qbasic in a quarter of a century, so my apologies if any of these are outdated.

I listed 13 here as I don't know what are being qualified as "commands" (I'm sure print is in there, but INT? LEN? these might be interpreted not so much as commands as functions)

PRINT prints text on the screen.

PRINT "How much wood would a woodcuhck chuck?"

INPUT gets text from the user

INPUT woodchuckwood$

INT casts a value as an integer

w = INT(woodchuckwood)

OPEN opens a file for input/output

OPEN "woodchuck.consumption" FOR OUTPUT AS #f

OPEN "woodchuck.consumption" FOR INPUT AS #f

CLS clears the screen

CLS

LOCATE specifies the cursor's location on the screen

LOCATE 10, 10

INKEY$ reads a character from the input buffer

a$ = INKEY$

LEN returns the length of a string

l = LEN(a$)

CHR$ takes an int and returns it's ascii value

$enter = CHR$(13)

ASC() returns the ascii value of a character:

$space = ASC(" ")

DO...LOOP repeats a loop until a condition is met:

x = 0

DO

   x = x + 1

LOOP UNTIL x = 10

SHARED declares global values as being accessible locally

SHARED $username

SHELL executes an os command

SHELL "dir /w"

Megan wants to post a picture of her and her friend Jennifer on her social media page. What should Megan do before she posts the picture?

A. Add a caption.
B. Ask her friend for permission.
C. Make sure she looks good.
D. Edit the picture using Photoshop.

Answers

Answer:

B. Ask her friend for permission.

Explanation:

Answer: B ask her friend for permission

hope you do good on the test or quiz.. it would mean alot to be brainlEst

Drop a paper of A-4 size and a
piece of wood/plastic about 2-3
inches long, from a height more
than 10 feet. Note the time for both
to hit the ground. Now repeat the
experiment by folding the paper
once, twice, thrice... (as many
time as you can). Why every time
the travel time reduces for paper
and remains the same for
wooden/plastic piece. Does the
paper at any stage hit ground
before wooden/plastic piece? If
yes,

Answers

Folding the paper reduces the surface area/volume. Travel time reduces due to less friction.

The wooden or plastic piece never changes its amount of drag/friction in the atmosphere.

If the paper is folded/compressed small enough, such that it’s friction is less than the wood or plastic then yes it would fall faster.

In a perfect vacuum, there is no friction to factor in, thus both fall at same speed.

Identify and summarize the features of the Windows 7 backup utility.

Answers

Answer:it is slow

Explanation: slow

Answer:

IT can create a backup it can restore a backup and probably more

Explanation:

Explaining AutoCorrect
How is the AutoCorrect feature useful in Outlook 2016? Check all that apply.
It checks for common typing errors.
It can automatically fix the error while you are typing.
It suggests email recipients that might be interested in your message.
It underlines words that need spelling and grammar corrections.
It ensures that you are emailing the correct recipients.

Answers

Answer:

1.

2.

4.

Explanation:

Had the same question

What is the role of the connection medium?

Answers

wth does that mean?!

How much mail can be
stored in each mail box?​

Answers

Answer:

Most mailboxes are 1 - 4 GB with one or two larger.

Explanation:

What allows your computer to communicate over a network and access the Internet?

Answers

Answer:

To connect to the Internet and other computers on a network, a computer must have a NIC (network interface card) installed.

Explanation:

A network cable plugged into the NIC on one end and plugged into a cable modem, DSL modem, router, or switch can allow a computer to access the Internet and connect to other computers. ISPs (Internet service providers)

Which one of these is NOT a function of an operating system? *

Managing computer hardware
Managing computer software
Allowing humans to talk to the computer
Performing quick calculations

Answers

Answer:

Allowing humans to talk to the computer

Explanation:

the operating system manages the computer hardware and software

and it also allows the ALU to perform quick calculations

a man takes 30 step to cover 18 metre l,how many step he will needed to cover 3003m distance​

Answers

he will need to take 5,004 steps to cover 3003m distance
3003/18=166.8
166.8 x 30=5004
Answer is 5004

When comparing systems software and application software, what is the main difference?

Answers

Answer:

it is a

Explanation:

i did the test

Review the following definition of sustainable construction projects:
Sustainable construction projects demonstrate common sense applications of natural resources throughout the life of the project.
Sustainable projects also take into account the long-term effects on the environment, including how energy and materials are used and
recycled, which should be incorporated into the building itself.
Based on this definition, which of the following characteristics is not a characteristic of sustainable construction projects?

Energy and material efficiency in construction, operation, and maintenance.

Established technologies that have been in use for several decades

Low environmental impacts over the project's life cycle.

High ratio of renewable energy to fossil energy in construction, operation and maintenance,

Answers

Answer:

Established technologies that have been in use for several decades

Explanation:

Answer:I’m not sure

Explanation:

How did you generate a random number for the user to guess? by using the built-in randint function by using the built-in random function by using the random method from the random module by using the randint method from the random module

Answers

Answer:

by using the randint method from the random module

Explanation:

The randint() method is a method or function in the random python module. It is used to get or return an integer number within a specified range.

To use the method, the module must be imported into the python file with the "import random" statement, then the method is referenced using dot notation and specifying the range of integer numbers.

syntax: random.randint(first_number, last_number)

Note that the last number in the range is inclusive in the selection.

Answer:

A. randint

Explanation:

I got it right on a quiz

Merle wants to change the formatting of all bold cells to be non-bolded. Shania wants to copy the cell color,
border, and font from cell E12 to all of column D. Which best describes what each person should do?

A. Merle should use Find and Replace, and Shania should use the Format Painter.

B.Merle should use the Rules Manager, and Shania should use Find and Replace.

C.Merle should use the Format Painter, and Shania should use the Rules Manager.

D. Merle should use the Format Painter, and Shania should use Find and Replace.

Answers

Answer:

Merle should use Find and Replace, and Shania should use the Format Painter.

Explanation:

It's the most logical to me.. And that's what I'm gonna do on my test. =) hope it helps.

How Much did a case of soda (any kind your choice ) cost in 2004?
PLS HELP!!!!!!

Answers

Answer:

2004 88 cents for 2 cans

Explanation:

What do you hope that people see in your digital footprint 5 years from now? ​

Answers

Answer:

I hope they see me playing with my dog (who died a few months ago) Malikeye

Explanation:

none :)

A small business has been experiencing power outages in their area. When checking the IP-based security camera, they were not able to access the camera. They verified the camera was on and had power. What is MOST likely the problem?

Answers

Group of answer choices.

A. The camera has an invalid gateway address.

B. The camera has been damaged by the power outage.

C. The camera's memory card is full

D. The camera is not connected to the wireless network.

Answer:

D. The camera is not connected to the wireless network.

Explanation:

An IP address is an acronym for internet protocol address and it can be defined as a unique number assigned to a computer or other network devices, so as to differentiate each device from one another in an active network system. Thus, an IP address is typically used to uniquely identify each computer or network devices connected to the internet or network.

In Computer networking, IP address are classified into two (2) main categories and these are;

1. Local (internal) IP address.

2. Global (external) IP address.

In this scenario, a small business has been experiencing power outages in their area. When checking the IP-based security camera, they were not able to access the camera. They verified the camera was on and had power. Thus, what is most likely the problem is that, the camera is not connected to the wireless network.

This ultimately implies that, the IP-based security camera is only powered on but is not interconnected with the other devices on the wireless local area network (WLAN).

Allows input/output of audio info to and from the computer.

A. Central Processing Unit

B. Sound Card

C. Video Card

D. Audio Player

Answers

Answer:

sound card

.............

which devices is not found in the CPU​

Answers

Plz answer my question

The devices that is not found in the CPU​ is printer. The correct option is D.

What is CPU?

A central processing unit, sometimes known as a CPU, is a piece of electronic equipment that executes commands from software, enabling a computer or other device to carry out its functions.

The part of a computer that obtains and executes instructions is called the central processing unit (CPU).

A CAD system's CPU can be thought of as its brain. It is made up of a control unit, a number of registers, and an arithmetic and logic unit (ALU). The term "processor" is frequently used to refer to the CPU.

The size, speed, sophistication, and price of a printer varies. It is a device that receives text and graphic output from a computer and transmits the information to paper.

Thus, the correct option is D.

For more details regarding CPU, visit:

https://brainly.com/question/16254036

#SPJ6

Your question seems incomplete, the missing options are:

a. ALU

b. Control Unit

c. Instruction register

d. Printer

An application's certificate indicates the application -
A is regularly updated
B cannot be removed
C is installed
D is authentic

Answers

Answer:

D. is authentic

Explanation:

Authentication can be defined as the process of verifying the identity of an individual or electronic device. Authentication work based on the principle (framework) of matching an incoming request from a user or electronic device to a set of uniquely defined credentials.

Basically, authentication ensures a user is truly who he or she claims to be, as well as confirm that an electronic device is valid through the process of verification.

Biometrics, smart cards, digital certificates, and picture passwords are various methods that can be used to perform an authentication.

Hence, an application's certificate indicates the application is authentic. These certificates are generally referred to as digital certificates.

When an end user installs a software application or program, the computer or mobile device would automatically verify the digital signature contained in the software. If the authentication process is successful, the software would be installed. Else, the installation process would be terminated.

Other Questions
Select all the correct answers.Flynn has drafted a research paper using a word processor. Which of the following will help him to enhance the readability of the paper and give it a professional look?using bulleted or numbered liststracking revisions to the draftpresenting data in tablesinserting headers and footers on each pageformatting section headings in a different font type and size than body textSELECT ALL THAT APPLY WILL GIVE BRAINLIEST 435,506 rounded to nearest ten thousand What is the average speed velocity of the skier in the image? someone pls help me with this problem , in a rush !! how can you round 0.234 to the nearest hundredth? what is the linking verb in this sentence: Penicillin, one of our most important drugs, come from mold. Angle 1 and Angle 2 are a linear pair. Angle 1=x-15, and angle 2=x+77. Solve for x then find the measure of each angle. 50 points! Will mark brainliest! Pic is attached below :) please help me like rn ProblemJun used 56\,\text{cm}56cm56, start text, c, m, end text of ribbon to go around the edge of a rectangular lid. The lid was 13\,\text{cm}13cm13, start text, c, m, end text long.What is the width of the lid? Please help will mark brainliest! WEEEEEEEEEEEEEEEEEEEEEEE Which word is a synonym for matronly as used in this sentence?Hannah's matronly smile and kind advice always comforted her youngest brother.beautifulwidemotherlyeager Marcy brought 25 pencil for $1.50. What is the cost, in dollars, of 1 pencil. What is the value for X What is f(-3) if f(x) = 1/3x Soil in The blue ridge is high in ___. Which is red in color what is the equation of a line with a slope of -3 and a y-intercept of 9 Pls help due ASAP and show workings pls find the sum of the first 31 terms of 4,11,18,...