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
tiny-mole [99]
3 years ago
15

IN JAVA Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin ty

pe per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies.Ex: If the input is:0or less, output:no changeEx: If the input is:45the output is:1 quarter2 dimes Your program must define and call the following method. Positions 0-4 of coinVals should contain the number of dollars, quarters, dimes, nickels, and pennies, respectively.public static void exactChange(int userTotal, int[] coinVals)Note: This is a lab from a previous chapter that now requires the use of a method.USE THIS SKELETONimport java.util.Scanner;public class LabProgram {/* Define your method here */public static void main(String[] args) {/* Type your code here. */}}IN JAVA
Computers and Technology
1 answer:
irina1246 [14]3 years ago
8 0

Answer:

..

Explanation:

I dont know how to code in java yet, I'm sorry. btw do you code in python?

You might be interested in
What are the defenses to protect against these attacks?
Scilla [17]
McAfee, Norton(totally overprotective tho), if you have a Chromebook Chrome OS(even more protective), Windows Defender on Win 10...
3 0
3 years ago
It is important to keep a copy of your written plan and safety records off-site. A) True B) False
mel-nik [20]

The answer for the question is true

3 0
4 years ago
Read 2 more answers
How are XY coordinates utilized in construct ?
marshall27 [118]

Answer:

In 2d space we can describe an object's position using 2 values that represent an object's placement on a grid, invisible or not. Typically this is referred to as a 2d coordinate; X and Y. X describes which column the object is in and Y tells what row the object is in. It is pretty much like bingo. A 2d coordinate should look something like these examples: (56,2) or (-1,3). The first number is the X position and tells us how far left or right the position is. The second number is Y and tells us an objects position up and down.

The pixel at the very top left of your screen is always pixel (0,0) - not (1,1). This is because computers always start counting at 0. They think of 0 as being the first position a number can be. This means if your screen is 640 pixels wide, your screen X position will go from 0-639. Any object on screen will have an (x,y) position. and this position can be manipulated by changing these values.

If you subtract from an objects X position it will appear to move left. If you add to it, it will seem as the object is going to the right. Adding to the Y value makes the object go down and subtracting from Y makes it go up.

Just remember: Add to X = right, Subtract from X = left, Add to Y = down, and subtract from Y = Up.

The more you handle (X,Y) coordinates the more second nature this becomes, so don't worry if it seems odd at first.

MOVING AN OBJECT USING VELOCITY

If you simply change an objects position to where you want it to be it will seem as if it is teleporting. Going from (10,10) to (100,100) is a big jump. If you want an object to seem as if it is moving from one place to another then you need to gradually change its position over time. This is an easy process.

In construct 2, a sprite object already has an X and Y position, so all you need to do is create 2 variables, each representing velocity along either the X or Y axis. I normally call them velocityX and velocityY.

Every frame of the game you then add velocity to position. It looks like this below:

notice that I am multiplying velocity by dt. dt stands for Delta Time and tells us how much time has passed since our last frame. Most games will run 60 frames per second, meaning the computer will run the code you made 60 times a second. In this case dt = 0.0166666- or 1/60. Since we want our velocity to be in pixels per second (and not per frame) we multiply velocity by dt. If our velocity was 100 then per frame it would only add 1.6666 to the position of an object. Over the course of a full second the total of the changes will equal 100.

velocity dt frames per second = velocity.

Here is a quick velocity cheat sheet; The velocity of the object is on the left, described using X and Y. The direction the object would be moving as a result is written next to it.

(0,0) - not moving.

(1,0) - moving right.

(-1,0) - moving left.

(0,1) - moving down.

(0,-1) - moving up.

(-1,-1) - moving diagonally up left.

(1,-1) - moving diagonally up right.

(-1,1) - moving diagonally down left.

(1,1) - moving diagonally down right.

Hopefully that wraps it up. Let me know if you have questions.

Introduction to rotation and angles!

6 0
4 years ago
PLEASE ANSWER THIS IM IN A QUIZ
Irina18 [472]

Answer:

B. hardware problem.

Explanation:

A monitor can be defined as an electronic device that is used to graphically display data (informations) for users working on a computer.

Simply stated, a monitor is a hardware device that serves as an output source for a computer system.

If images around the edges of a monitor do not look right, the computer might have a hardware problem because the monitor of a computer is a hardware device. Common hardware problems associated with computer monitors are improper visual display, flickering, vertical lines, blotches, ink spots, random shutdown etc.

8 0
3 years ago
Read 2 more answers
A program reads three integer values. The three values are interpreted as representing the lengths of the sides of a triangle. T
Andru [333]

Answer:

5

Explanation:

5 0
4 years ago
Other questions:
  • For each of the following data storage needs, describe which abstract data types you would suggest using. Natural choices would
    15·1 answer
  • Using an LCD projector to show an online video to a group of people is an example of:
    14·1 answer
  • Create a list of 15 colleges in Texas
    8·2 answers
  • How do you choose the amount of points you give a person here on this brainless app...??.
    11·2 answers
  • What is the primary benefit of using solid state storage
    7·1 answer
  • The variable most_recent_novel is associated with a dictionary that maps the names of novelists to their most recently published
    12·1 answer
  • Difference between primary key and foreign key
    12·1 answer
  • A celebrity blogger you have followed for years advises readers to try a new beauty product. Before purchasing the product, a sa
    10·1 answer
  • Given the following code, assume the myStack object is a stack that can hold integers and that value is an int variable. Assume
    8·1 answer
  • The electors in each state shall have the qualifications requisite for electors of the most numerous branch of the state legisla
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!