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
andrezito [222]
3 years ago
10

// This class calculates a waitperson's tip as 15% of the bill public class DebugThree1 { public static void main(String args[])

{ double myCheck = 50.00; double yourCheck = 19.95; System.out.println("Tips are"); calcTip(myCheck); calctip(yourCheck); } public static int calcTip(int bill) { final double RATE = 0.15; tip = bill + RATE; System.out.println("The tip should be at least " + tip); } }
Computers and Technology
1 answer:
DENIUS [597]3 years ago
4 0

I added a decimal format to keep all decimals within the hundredths place. I also changed the calcTip method to void and the argument to a double. Void means the method doesn't return anything and changing bill to type double let's us pass numbers with decimals to the calcTip method. I hope this helps!

Download txt
You might be interested in
What is it called when you give credit in your writing to someone else's quote?
katrin2010 [14]
Answer: citation

There are two basic ways to give credit to another person in your writing.

(a) The use of a signal phrase.
For example, you might write this:
According to John Doe (2005),  Author of "Old Classic Novels", it is necessary to understand  ...

(b) In-Text Citation.
For example, you might write:
It is necessary to understand ... (John Doe, 2005, p. 65-70)

In this case, the reference is provided at the end of the article or as a footnote.

3 0
3 years ago
Part of the operating system core is responsible for controlling security, managing the file system, and providing a platform fo
mel-nik [20]

Answer:

Kernel

Explanation:

The Kernel is the part of the operating system core which is responsible for controlling security, managing the file system, and providing a platform for applications to run on.

5 0
3 years ago
Define a method printAll() for class PetData that prints output as follows with inputs "Fluffy", 5, and 4444. Hint: Make use of
Vsevolod [243]

Answer and Explanation:

public class petData

{

private int ageYears;

private String fullName;

private int IdNumber;

public void setName (String givenName)

{

fullName = givenName;

return;

}

public void setAge (int numYears)

{

ageYears = numYears;

return;

}

public void setID (int numID)

{

IdNumber = numID;

return;

}

public void printAll ()

{

System.out.print ("Name: " + fullName);

System.out.print (", Age: " + ageYears);

return;

}

}

From the above, we have defined a class petData, with methods setName, setAge, printAll. These methods all make use of the string variable fullName and integer variable ageYears. From the above, setName method sets fullName variable to name given to its string parameter givenName while setAge method does the same with the ageYears variable in initializing it. This is also done by the ID method. These variables are then used by printAll method in printing out the Name and age of the object which would be created with the petData class

E. g: petData dog= new petData();

3 0
4 years ago
Why will it take so long to complete the high-speed rail route?
koban [17]
It will take a while for all of the necessary safety inspections. 
3 0
3 years ago
Read 2 more answers
User can use ______ commands to search for and correct words in a document
Maksim231197 [3]
Find and replace is the answer
5 0
3 years ago
Other questions:
  • When using a graphics editing program, which option allows you to adjust the space around an image?
    15·1 answer
  • Write a program that declares an array of size 1,230 and stores the first 1,230 prime numbers in this array. The program then us
    6·1 answer
  • You can change the color of the value of a cell or the background
    14·2 answers
  • List the six external parts or "peripherals" of a computer system and identify which are the output and which are the input devi
    6·1 answer
  • DSSS uses a chipping code to encode redundant data into the modulated signal. Which two of the following are examples of chippin
    12·1 answer
  • If you were looking for a record in a very large database and you knew the ID number, which of the following would be the most d
    6·1 answer
  • When operating a forklift, what should you do to ensure a clear view and proper balance when traveling with a load?
    6·2 answers
  • One example of a <br> is the length of a car.
    7·1 answer
  • HELP PLEASE!!!!!!!!!<br> Please fix the coding! thanks I give brainliest
    5·1 answer
  • Which database can be used to find studies related to allied health sciences?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!