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
xz_007 [3.2K]
2 years ago
14

Design a modular program IN JAVA that asks the user to enter the monthly costs for the

Computers and Technology
1 answer:
Lerok [7]2 years ago
4 0

A modular program IN JAVA that asks the user to enter the monthly costs for the given expenses incurred is as detailed below.

<h3>How to design a Modular Program in Java?</h3>

Module main()

             // declare variablesDeclare Real loanpayment, insurance, gas,

             oil, tires, maintenance,sum

             // Display an intro message.

             Call showIntro()

             //getting loanpaymentexpense as input

             Display “Enter expense incurred from loan payment:

             “Input loanpayment

             //getting insurance expense as input

             Display “Enter expense incurred from insurance:

             “Input insurance

             //getting gasexpense as input

             Display “Enter expense incurred from gas:

             “Input gas//getting oil expense as input

             Display “Enter expense incurred from oil:

             “Input oil//getting tires expense asinput

             Display “Enter expense incurred from tires:

             “Input tires

             //getting maintenance expense asinput

             Display “Enter expense incurred from maintenance:

             “Input maintenance

             Sum = loanpayment +  insurance + gas + oil + tires +

             maintenance

             Call monthlyCost(Sum)

             Call annualCost(Sum)

             Call s h o w E n d M s g ()

End main

Module showIntro()

              Display “A program to calculate costs for expenses incurred

              from operating automobile”

End showIntro

monthlyCost(Real Sum)

               Display “Total monthly cost of expenses incurred from

               operating automobile: “, Sum

End monthlyCost

annualCost(Real Sum)

                Display “Total annual cost of expenses incurred from operating

                automobile: “, (Sum * 12)

End annualCost

Read more about Java program at; brainly.com/question/18554491

#SPJ1

You might be interested in
Which statement best describes the purpose of SmartArt graphics in PowerPoint presentations?
Alchen [17]

Answer:

They are an easy mechanism for combining text and graphics.

Explanation:

7 0
3 years ago
Read 2 more answers
What is computer hadware​
Alex Ar [27]

Answer: like the monitor or the keyboard

Explanation: it is true i even looked it up and it was true

8 0
2 years ago
In 25 words or fewer, identify what calendar feature the recurring task function copies.
alexdok [17]
Shhsnanwnwnsjssnsnnwnsn
7 0
4 years ago
Print either "Fruit", "Drink", or "Unknown" (followed by a newline) depending on the value of userItem. Print "Unknown" (followe
vagabundo [1.1K]

Answer:

I am writing a C++ program. Let me know if you want the program in some other programming language. Here is the portion of the code:

if((userItem == GR_APPLES) || (userItem == GR_BANANAS)){

 cout << "Fruit";   }

else if((userItem == GR_JUICE) || (userItem == GR_WATER)){

 cout << "Drink";  }

else{

 cout << "Unknown";  }  

cout << endl;

 

Explanation:

The IF statement is used to check the defined options with the value in the userItem.

If the value of the userItem is GR_APPLES OR GR_BANANAS then Fruit is printed as the output. || represents a logical operator OR so this means that userItem can be either the GR_APPLES or GR_BANANAS for the If condition to evaluate to true.

If the above condition evaluates to false then the else-if part will be checked next. So the else if checks if the value in the userItem is GR_JUICE or GR_WATER. If userItem contains either of these two then Drink is displayed on the screen as output.

If the else-if statement also evaluates to false then the else part is executed which displays Unknown.

The cout<< endl; statement in the last is used to print the new line. For example if the output is Unknown then it is followed by a new line.

In the given program userItem is set to GR_APPLES

GroceryItem userItem = GR_APPLES

So the output of the whole program is Fruit followed by a new line.

The screenshot of the code along with the output is attached.

7 0
4 years ago
If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, what is a likely cause of the error message
yulyashka [42]
<span>If you sort a portion of an Excel sheet and you get an error message such as #DIV/0, the cause of the error message is (B) one or more cells containing absolute cell references. The possible reason of this error message includes: (1) e</span><span>ntering division formula that divided by zero (0), (2) and that is being used as a reference.</span>
7 0
3 years ago
Other questions:
  • Why is the rate of increasing performance slowing down? Please help
    8·1 answer
  • Describe the functions of ALU, resisters, CU, BIU, Cache and FPU.
    7·1 answer
  • Which of the following relationships between variables could be shown with a scatter plot graph?
    8·1 answer
  • A Turing machine with doubly infinite tape (TMDIT) is similar to an ordinary Turing machine except that its tape is infinite to
    8·1 answer
  • Which code will allow Jean to print Coding rocks! on the screen?
    6·1 answer
  • What mistake might you make related to changing the data in a cell that's used in a formula?
    14·1 answer
  • 1. What is the difference between the wireless network that you provide to your customers versus the wireless network that you w
    5·1 answer
  • In order to restrict editing to a document, a user will go to Review, , Restrict Editing, and will then select what kinds of edi
    12·1 answer
  • Can anyone help me with a mental ability work plzz
    12·1 answer
  • I wanna be the very best
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!