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
juin [17]
4 years ago
13

Write a method named quarterstodollars. the method should accept an int argument that is a number of quarters, and return the eq

uivalent number of dollars as a double. for example, if you pass 4 as an argument, the method should return 1.0; and if you pass 7 as an argument, the method should return 1.75.

Computers and Technology
2 answers:
enyata [817]4 years ago
7 0
 public static void quarterstodollars(String[] args) {    Scanner input = new Scanner(System.in);    System.out.println("Enter number of Quarters:");
    System.out.print("Quarters:");    int Q1 = input.nextInt();
DecimalFormat fmt = new DecimalFormat("$#,###.##");    System.out.println("Total:"+fmt.format(calctotal(Q1)));}public static double calctotal(int Q1) {    double total;    total=(0.25 * Q1);    return (total);}

Hope this helps!
Stolb23 [73]4 years ago
7 0

Answer:

def quarterstodollars():

   quarters = float(input('Enter Quarter: '))

   dollar = quarters / 4

   return dollar

print(quaterstodollars())

Explanation:

Programming language used is Python.

The program starts by first defining the function using the def keyword.

It then prompts the user to enter a quarter, the input is converted to a floating type number and it is stored in the quarters variable.

To calculate the dollar equivalent, the quarter is divided by 4.

Finally, the dollar value is returned.

The last line calls the method. check image to see the result.

You might be interested in
"What Search Network text ad component provides up to three fields of 30 characters each?"
Alex_Xolod [135]

Answer:

The headline component is the correct answer.

Explanation:

The headline component provides their user a better experience to modify the text or fonts of the heading and simple text with that links which is inline to those pages that displaying the topics, articles and also the discussions. This is also used for the particular search network text and also for the google ads components. So, that's why the following option is correct.

7 0
3 years ago
What would be the total width of the div in the code below?
Artyom0805 [142]

Answer:

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

Explanation:

The correct answer to this question is d- 346px.

The complete code of this example is given below:

<div>

style="margin:20px; border:solid 3px #888888;">

</div>

while the image width is 300px.

It is noted that the image width is 300px and the margin is 20 px.

Margin:20px means that image margin from four side is 20 px each.

So the width of dive from both side increase to 40 px and the image has 300 px, then total width becomes 340px. Now the border also has 3px of four sides of the image, then the width of the border becomes 6px.

so the total width of the div tag is 346 px.

In short, we can calculate the width of tag as below:

total width of div= width of image+ width of margin+ width of border

total width of dive= 300px+40px+6px

total width of div=346px.

4 0
3 years ago
Read 2 more answers
What new england industry quickly collapsed with the discovery of oil in pennsylvania
Elena-2011 [213]

It was the whaling industry.  Whaling use to be the main source of oil that was used for fuel and lighting in America which was based in the coastal communities of New England.  It went into decline when oil was discovered in 1859.  Eventually it replaced whale oil as a source of fuel and life.

6 0
3 years ago
Read 2 more answers
Samantha is in the beginning stages of OOP program development. What are the five steps she must follow for creating an OOP prog
lora16 [44]

Answer:

1. Classes and objects

2. Inheritance

3. Polymorphism

4. Data hiding/ encapsulation

5. Interfaces.

Explanation:

Classes and objects depict the major component of the OOP (object oriented programming). It explains the object like a ball in a soccer game development.

The inheritance is like the subclass of the object. Data hiding is a stage in oop where the codes or data are hidden from another users.

In the polymorphism stage, the object is given the ability to change to a sub-object, while in the interface stage a function or method signature is defined without implementing it.

3 0
4 years ago
Read 2 more answers
G The method of mapping where each memory locationis mapped to exactly one location in the cache is
Otrada [13]

Answer:

Direct Mapped Cache

Explanation:

Given that a Direct Mapped Cache is a form of mapping whereby each main memory address is mapped into precisely one cache block.

It is considered cheaper compared to the associative method of cache mapping, and it is faster when searching through it. This is because it utilizes a tag field only.

Hence, The method of mapping where each memory location is mapped to exactly one location in the cache is "Direct Mapped Cache"

4 0
3 years ago
Other questions:
  • Is a software program that allows users to access the world wide web
    10·1 answer
  • Based on the Standards, the statement, "Competition for computer time during periods of high demand had become intense because o
    8·1 answer
  • Write a program to read data from a file named problem 2. ext. This file has three exams data (floating point data) in three col
    11·1 answer
  • Ted knows that macros can be helpful to him in his work with Excel spreadsheets,but he also knows they have their hazards,so he
    15·1 answer
  • 1. select the correct answer from the given options.
    5·1 answer
  • If you could design your own home, what kinds of labor-saving computer network or data communications devices would you incorpor
    9·1 answer
  • With _________, users will receive recommendations for items liked by similar users.
    9·1 answer
  • Is Brainly cheating??
    10·2 answers
  • In order to detect repeated lines anywhere in the input, myuniq must keep track of all of the lines it has seen as it moves thro
    9·1 answer
  • What are the impacts of mobile phone?as well as the positive and negative impacts?​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!