(Java)Write a program that calculates and displays the conversion of an entered number of dollars into currency denominations—20s, 10s, 5s, and 1s. Example output: $452 converted is 22 $20s, 1 $10s, 0 $5s, and 2 $1s.​

Answers

Answer 1

Answer:

Below!

Explanation:

This is the code I have. I am not sure what I am missing that it won't accept -  

import java.util.Scanner;

class Dollars {

   public static void main(String[] args) {

            int numTwenties,numTens,numFives,numOnes,dollarAmount;  

       Scanner sc= new Scanner(System.in);

       System.out.println("Please enter a dollar amount: ");  

       dollarAmount = sc.nextInt();

        numTwenties = dollarAmount/20;

        numTens = (dollarAmount - 20*numTwenties)/10;

        numFives = (dollarAmount - (10*numTens + 20*numTwenties))/5;

        numOnes = (dollarAmount - (10*numTens + 20*numTwenties + 5*numFives));

       System.out.println(+ dollarAmount + " converted is" + numTwenties + " $20s, " + numTens + " $10s, " + numFives + " $5s, and " + numOnes + " $1s.");  

   }

}

This is what it is giving me -

Test CaseIncomplete

Dollars 598

Input598

OutputPlease enter a dollar amount: 598

598 converted is29 $20s, 1 $10s, 1 $5s, and 3 $1s.

Results

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

Expected Output

$598 converted is 29 $20s, 1 $10s, 1 $5s, and 3 $1s

Answer 2

It's mainly the price measure with one currency against the other, even as rate changes, money through one country can get relatively weak or powerful in comparison with the other currencies, and the further program can be defined as follows:

Program Explanation:

Import package.Defining a class Conversion .Defining an integer variable "twenties, tens, fives, ones, amount, n".After defining a variable, a Scanner class object is declared that inputs value in it.In the next step, a conditional statement is declared that checks value and hold its calcuated value.At the last, a print method is declared that prints its value.

Program:

import java.util.*;//import package  

public class Conversion //defining a class Conversion

{

   public static void main(String ar[])//defining a main method

   {

       int twenties, tens, fives, ones, amount, n;//defining an integer variable

       Scanner obcdf= new Scanner(System.in);//creating Scanner class object to input value

       System.out.println("Enter amount: ");//print message

       amount = obcdf.nextInt(); //input integer value

       n =  amount; //holding innput value

       if(amount > 20)//using if block that check amount value greater than 20

       {

           twenties = (int)(amount/20); //using twenties that divides amount value by 20 and hold its integer value  

           amount = amount % 20;// holding modules value in amount variable

       }

       else  //defining else block

       {

           twenties = 0;//holding 0 in twenties variable  

       }

       if(amount > 10)//using if that check amount value greater than 10

       {

           tens = (int)(amount/10);//using tens that divides amount value by 10 and hold its integer value

           amount = amount % 10;// holding modules value in amount variable

       }

       else  //defining else block

       {

           tens = 0;//holding 0 in tens variable  

       }

       if(amount > 5)//using if that check amount value greater than 5

       {

           fives = (int)(amount/5);//using tens that divides amount value by 5 and hold its integer value

           amount = amount % 5;// holding modules value in amount variable

       }

       else //defining else block

       {

           fives = 0;//holding 0 in fives variable  

       }

       if(amount > 1)//using if that check amount value greater than 1

       {

           ones = (int) amount;//holding amount value in ones variable

       }

       else //defining else block

       {

           ones = 0;//holding 0 in ones variable

       }  

       System.out.println("$"+n+" converted is "+twenties+" $20s, "+tens+" $10s, "+fives+" $5s, and "+ones+" $1s."); //print value

   }

}

Output:

Please find the attached file.

Learn more:

brainly.com/question/4448370

(Java)Write A Program That Calculates And Displays The Conversion Of An Entered Number Of Dollars Into

Related Questions

What is one way to make a presentation stand out by using PowerPoint Online?

Use different images and videos throughout the presentation.

Use a plain white background throughout the presentation.

Use the same font and font size throughout the presentation.

Use the same slide format throughout the presentation.

Answers

Answer:

Answer: Use different images and videos throughout the presentation.

Explanation:

I just took this test and got it correct :)

Answer:

give person on top brainlist they are right i got 100 percent

Explanation:

thank you

What is a frame injection attack in a wireless network?

A. A hacker inserts a forged frame during data transmission.

B. A hacker creates a botnet to flood a particular website.

C. A hacker sniffs data packets from a data transmission.

D. A hacker deletes frames during a data transmission.

The answer is A.

Answers

Answer:

A.Un hacker introduce un cadru fals în timpul transmiterii datelor.

Explanation:

A - a hacker inserts a forged frame during data transmissions

can someone please help its late

Answers

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

The labels to AS engine are given below from left to right respectively.

FanCompressorCombustionTurbineMixer Nozzle

Fan: Drawer air into the engine

Compressor: Compressor spins the air very fast. This sequeezes or compresses the air

Combustion: Air and fuel are mixed together and ignited in the combustor and it gets super hot and gas expanded.

Turbine: The hot gases enter the turbine, causing the blade on it to spin.

Mixer: The mixer combines the hot air with outside air in the engine. This reduces the heat and noise that is coming from the engine.

Nozzle: nozzle is where the exhaust is coming out from the engine, creating thrust. It works according to newton's third law.

What is the first thing animators need to determine when beginning a project?



a Editing locations



b Length of the film or project



c Setting



d Characters

Answers

Answer:c

Explanation:

how are web design & web development different from each other?

Answers

Answer:

Developers are people who build a website's core structure using coding languages, while designers are more visually creative and user-focused. Developers use their programming knowledge to breathe life into the designer’s creative vision.

You could think of developers as construction workers, and web designers as architects – both necessary, but different, skill sets.

I hope this helped :D

Explanation:

A student who might find digital learning challenging.

Answers

Digital learning exists mostly online, while traditional learning takes place in a classroom building.

Answer: it is "A"

|Likes meeting other students.|

what is wrong with this picture?????

Answers

“you got a tight little-“

uhm y’know everything is wrong with it terrifying really is uhm but yeah.

oh god that leg tho

Most portable devices, and some computer monitors have a special steel bracket security slot built into the case, which can be used in conjunction with a:

Answers

Answer:

Instead of using a key or entering a code to open a door, a user can use an object, such as an ID badge, to identify themselves in order to gain access to a secure area. What term describes this type of object?

Explanation:

Select the correct answer
Which filter enhances the color contrast around the edges of an image?

A. Texture filters

B.Sharpen filters

C.Blur filters

D.Noise filters

Answers

Answer: C. Blur filters

Explanation:

The unsharp mask filters or blur filters can be used for professional color correction. This will adjust the contrast of the image. Edge details and may produce a darker and lighter line on all side of the edges. This helps in creating illusion or blur image giving a sharp contrast and sharper image.

So, the color answer C. Blur filters

Answer:

B, Sharpen Filters

Explanation:

i got it right lol

Match the terms with their definitions

Answers

Answer:

Malware goes with the third definition, single sign-on goes to the fourth definition, phishing goes to the second definition, and clickjacking goes to the first definition.

Hope this helps! :)

Malware = a term used for software designed to damage your computer or steal your personal information

Single sign-on = when you use a single credential to log into multiple websites

Phishing = when random links mislead you into giving your password or other vital information to an unscrupulous website or person

Clickjacking = when you unknowingly click a malicious link, thinking it to be a legitimate link
:)

Click to review the online content. Then answer the question(s) below, using complete sentences. Scroll down to view additional
questions
Online Content Site 1
Why isn't a good idea to study in bed?

Answers

Answer:

yes.. it is not good.

Explanation:

because its can calm our mindy & sleep quickly.

Answer:

I think avoiding stress and something/ anything disturbing your health is an effective conflict. In my opinion avoiding stress and anything disturbing your health is bad because the more time you ignore it the worse it get's.

Explanation:

I got it right on Edg.

Proof:

Fill in the blanks : To store 3 character a computer occupies...................bytes memory space​

Answers

Answer:

Umm was there supposed to be a picture????

Explanation:

Hope you have a wonderful Christmas Eve time with your family!!❄️

Eight bits are called a byte. One byte character sets can contain 256 characters. The current standard, though, is Unicode, which uses two bytes to represent all characters in all writing systems in the world in a single set.

What is memory space?

Memory refers to the location of short-term data, while storage refers to the location of data stored on a long-term basis. Memory is the power of the brain to recall experiences or information.

Memory is most often referred to as the primary storage on a computer, such as RAM. Memory is also where information is processed. It enables users to access data that is stored for a short time.

Learn more about Memory here,

https://brainly.com/question/23423029

#SPJ2

What do you mean by word-wrap?

Answers

Answer:

it is also know as line breaking

Explanation:

is breaking a section of text into lines so that it will fit into the available width of a page, window or other display area

Which tab in MS Word would you select to insert a shape into a document? Question 6 options: Insert Review View File

Answers

Answer:

Insert

Explanation:

Under the insert tab, shapes will be an option to put in under the illustrations category.

Answer:

um insert?

Explanation:

im assuming its insert bc you said "to insert a shape into a document" so yh

i hope this helped?

Which is the most recent version of Microsoft Windows?


Windows 10


Windows NT


Windows Service Pack 2


Windows Longhorn

Answers

Answer:

Windows 10

Explanation:

Answer:

Windows 10

Explanation:

Windows 10 was released in 2015 while other are old

Which of the following is an object-oriented language?

A. C
B. C++
C. BASIC
D. COBOL

Answers

Answer:

C++

Explanation:

Significant object-oriented languages include: (list order based on TIOBE index) Java, C++, C#, Python, R, PHP, Visual Basic.NET, JavaScript, Ruby, Perl, Object Pascal, Objective-C, Dart, Swift, Scala, Kotlin, Common Lisp, MATLAB, and Smalltalk.

The programs' structure is made obvious via OOP. OOP makes the C++ code easier to maintain, alter, and debug by encouraging “Don't Repeat Yourself” (DRY) programming practices. OOP allows for quicker development times and less code needed to create fully reusable apps. Thus, option B is correct.

What role of C++ as an object-oriented language?

The following are several justifications for calling C++ a partial or semi-object oriented language. The primary action is not a class action.

Object-oriented programming is supported by C++, but it is not a feature of the language itself. You don't even need to use an object once to construct a legitimate, well-coded, and brilliantly styled C++ program.

Therefore, Object-oriented programming can be implemented using C++'s core features. It contains classes and objects as well as the OOP principles of inheritance, encapsulation, abstraction, and polymorphism. It also has access to specifiers.

Learn more about language here:

https://brainly.com/question/29751978

#SPJ2

Which scenarios are examples of students managing their time well? Check all that apply. A student studies while watching her favorite television shows. A student sets aside time to study every afternoon at his desk. O A student writes down some goals that she hopes to achieve in school. A student drafts a study schedule that includes breaks. A student uses her desk calendar to record the due dates for her homework assignments. O A student rushes through his homework while sending text messages to friends. 3). Intro​

Answers

Answer:

b,c,d, and e

Explanation:

Hope this helps

Answer:

BCDE

Explanation:

EDG 2021

Linux implements _________ to determine how a user is to be authenticated and whether there are password policies associated with password databases.

Answers

Answer:

Pluggable authentication modules (PAM).

Explanation:

These are schemes that are seen to be used in API authentication. It is relyed on to provide high authentification protocool in any correct form it is seen to be in use. also its ability to grant access to each other within two people interface are reasons big user clients refer to it in most of their policies that deals with their working system passwords and their database passwords to most of their files. This is why the company in the context which is a big firm rely on it for its services.

Kali, a Python programmer, is using the turtle module to write the word “hello.” Which code should she use to indicate the location to begin writing the word?

Answers

Answer:

c

Explanation:

Assume that x and y are boolean variables and have been properly initialized. !(x || y) || (x || y) The result of evaluating the expression above is best described as:

Answers

Answer:

The answer is "Always true "

Explanation:

Following are the program to this question:

#include <iostream>//header file

using namespace std;

int main()//main method

{

bool x=true;//defining bool variable x and assign value

bool y=false;//defining bool variable y and assign value

if(!(x || y) || (x || y))//use given condition with if block

{

   cout<<"True";//print true message

}

else//defining else block

{

   cout<<"false";//print false message

}

   return 0;

}

In the above code two bool variable is declared, that hold ture and false, and used in the given expression with the condition statement, that checks the given value. In the code the logical gate OR gate that always print the true value.

6
development with reference to Nepal.
Mention the objectives of sustainable development,
How can you relate the role of environment while can​

Answers

Answer:

objective of sustainable development are:

Explanation:

1.to help in poverty alleviation

2.to conserve the environment effectively

3.to gain human development and progress

4.to use resources and means carefully

Kerri is adding text and graphics to her presentation. She does this work in the _____. Normal (Slide) view Task pane Formatting toolbar Slide Sorter

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is Normal View.

Kerri can add text and graphics to her presentation. She does this work easily in the Normal view of the slides. In normal view, you can edit your slide by slide and navigate with the thumbnail.

while other options are not correct because:

Task pan is used to show information about the current slide.

Formatting toolbar is used for formatting the contents in the slide

Slide sorter is a view that is used to see the thumbnail of all slides in your presentation to easily rearrange them.

What are some legal issues that can arise from the use of all social media?

Answers

Answer:

CopyrightDefamationCyberbullying

Explanation:

The first issue, that I would like to explain is Copyright. If you are imposing as a company on Social Media with a real name that is Copyrighted, the company will file a DMCA takedown notice which is the Digital Millennium Copyright Act

. Which can result in your Social Media being taken down, or by getting a fine, sued or even jailtime.

The second issue is Defamation, what Defamation is basically spreading false information about a company / business in real or online that hurts a companies reputation. If you commit this crime online you can face a lawsuit or even jailtime for one year.

Thirdly, cyberbullying. This is illegal in most states in the US. Cyberbullying is a serious matter and depending on your states laws can be charged with criminal harassment.

Sources:

Quora: (Website)

Miclaw: (Website)

Statista: (Website)

Write pseudocode for washing a car using at least five steps.

Answers

Answer:

Step 1: Prepare the Cleaner

Pour a capful of car wash cleaner into a bucket and fill it a little over halfway with tap water. Car wash soap is specially designed to clean a car's exterior surfaces without stripping off wax, and it is typically sold alongside wax and car-detailing products in stores. Toss the first sponge in the bucket to let it soak up water and cleaner.

Step 2: ​Use the Garden Hose First

Spray water all over the car, starting at the top and working down the body of the car.

Step 3: Wash the Roof

Wash the top of the car first by squishing most of the excess water out of the sponge, then begin washing. Rinse the top as soon as you finish to ensure that the cleaning product does not dry on your car's paint. Blot the excess water off with your chamois or a terry cloth towel.

Step 4: Wash the Car's Body

Wash the car's body in sections, one panel at a time. Spray each panel with the garden hose again before washing with the sponge and cleaner. Rinse immediately after washing.If the water is not drying too fast, complete one whole side of the car before drying. If the water is drying quickly, dry each panel as soon as you finish washing.

Step 5: Wash the Wheel and Tires

Spray the wheel and tire cleaner on the wheels and tires.Using the second sponge, a brush or a rag, rub the cleaner into the tires to remove any remaining road dirt.

Step 6: Drying Your Car

Check your product's label to see if it needs to be washed off with water or buffed with a clean rag to complete the project.

b) Describe the computer processing that is required to maintain the correct growing
conditions.​

Answers

Answer:

Explanation:To get the best plant growing conditions, the temperature and humidity (moisture in the air) have to be controlled.

The greenhouse therefore has temperature and humidity sensors linked to a computer, and the computer has a control program storing details of the correct temperature and humidity settings. The greenhouse is fitted with a heater, sprinkler and window motor which are also linked to the computer.

If the humidity falls below the values stored in the program, the computer activates the sprinklers and closes the windows. If the temperature falls outside the values stored in the program, the heater is activated by the computer.

what does good time management mean​

Answers

Answer:

When you are consistent with your work and not wasting time

Explanation:

Time management to me means using your time wisely and thing you have to get done do those things first before doing something that is not a must. Being wise with your time will help you complete goals and more in life.

Have a good day and a merry Christmas

Noodletools is one of the Online databases available at the BLA library
website. I can print a copy and/or export a copy of my citations from
Noodletools.
True
False

Answers

Answer: true

Explanation:

A CD and a DVD are both secondary storage devices, explain to a friend the difference between both​

Answers

Answer:

i dont have any friends to explain it to

Explanation:

Read the following scenario. How might Sarah correct successfully complete her task?
To permanently remove a file from her computer, Sarah doubled-clicked on the My Computer icon and searched for her
file under the “Uninstall or change a program" menu option. A

Answers

Answer:

Explanation:

A: To permanently remove a file from her computer, Sarah doubled-clicked on the My Computer icon and searched for her file under the “Uninstall or change a program” menu option.

or

b: empty the recycle bin : You can permanently delete a program file installed in the computer by following the procedure in option A. The option above will take you to the control panel and you'll be able to select the program you'd want to permanently remove. If you had initially deleted a file like a picture or a document or anything else that you necessarily do not need, it will go to recycle bin. You can head over there and select the Empty the Recycle Bin option to permanently delete the file.

What are the most common forms of information?

Answers

Answer: web search

Explanation:

Other Questions
if resistors were 10 times larger what would happen to output voltage 9. A student notices that wearing darker colors in sunlight makes him feel warmer, so he decides to conduct an experiment. He takes five pieces of differentcolored cloth and wrapseach one around a water bottle. He then places all five bottles in direct sunlight and measures the temperature of the water in each bottle an hour laterWhat is the dependent variable in this experiment?O the time he leaves it in the sunlightO the amount of water in each bottleO the color of the clothO the temperature of the water I need a summary of chapter 1 for the novel The Outsiders o>IUKnowing your sequence of ideas is important in making a report.a.Trueb. False Teamwork can be ____by diversity. O hamperedO hinderedO enhancedO undermined A community switches from a coal power plant to a wind power plant toobtain electricity. What is a likely outcome of this switch?A. Bird and bat populations will grow larger.B. Noise pollution in the community will decrease.C. Electricity will become less expensive.D. Acid rain will be reduced. A student used apparatus as shown above. The beaker held 750 g of a liquid. The current from the power supply was 1.8 A and the potential difference of the supply was 230 V. The temperature rose from 12 C to 40 C over a period of 2 minutes.Calculate the specific heat capacity of the liquid. One week, Rachel earned $250. She spent $120 on food, $30 on miscellaneous items, and saved the rest. If Rachel makes a pie chart showing how she spends her money, the central angle for the food sector would be __________. I need help guys please help .What was a result of King Philips War for the regions Native Americans?A.They received a large land grant.B.They signed a treaty giving up their land.C.They lost their power in New England.D.They were able to slow down colonial settlement. The HCF of two numbers is 20. The LCM of both numbers is a multiple of 14. One number is greater than the other, work out the smallest possible numbers given that 16 ounces equal 1 pound , how many ounces are in 6.7 pounds can someone help? which triangle is the same as ABC? I need help with that What property justifies that 6x+93=2x+3? th weight of an object is Mrs. Li wants to compare her students test scores to the school average. She created a table to help her.Mrs. Lis Student Test ScoresStudentScore compared to school averageAdam+3Bryan0Cierra4Devaughn+1Elena+5Fionna2Which list orders the students by lowest score to highest score?Bryan, Cierra, Fionna, Devaughn, Adam, ElenaCierra, Fionna, Bryan, Devaughn, Adam, ElenaElena, Adam, Devaughn, Bryan, Fionna, CierraBryan, Devaughn, Fionna, Adam, Cierra, Elena there are 10 boys and 20 girls in a class.the class has a test.the mean mark for the class is 60.the mean mark for the girls is 54.work out the mean mark for the boys. which expression can be written as 5x(2+7) One reason the United States became involved in WWI was our close economic and political ties to ?PLEASE HELP ME