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
givi [52]
2 years ago
10

Assume you are given three variables, revenue, expenses, and profit, all of type Money (a structured type with two int fields, d

ollars and cents). Assign to profit the result of subtracting expenses from revenue. Let's make the happy assumption that revenue exceeds expenses. However you still may find that the cents part of expenses exceeds that of revenue. If that is the case you will have to "borrow" 1 from revenue dollars (i.e. subtract 1) and "give" it to revenue's cents (i.e. add 100!) in order to carry out the subtraction properly.
Computers and Technology
1 answer:
Andre45 [30]2 years ago
7 0

Answer:

if(revenue.cents - expenses.cents < 0){

profit.dollars = revenue.dollars - expenses.dollars - 1;

profit.cents = 1 - revenue.cents - expenses.cents;

}

else{

profit.dollars = revenue.dollars - expenses.dollars;

profit.cents = revenue.cents - expenses.cents;

}

Explanation:

We know that profit is given as: revenue - expenses from the question.

From the given expression above;

if(revenue.cents - expenses.cents < 0)

then profit.dollar will be revenue.dollars - expenses.dollars - 1; the 1 is to be carry over to the cent part. And the profit.cent will be 1 - revenue.cents - expenses.cents;

else the profit.dollars and the profit.cent is computed directly without needing to carry over:

profit.dollars = revenue.dollars - expenses.dollars;

profit.cents = revenue.cents - expenses.cents;

You might be interested in
Which is NOT one of the basic characteristics of life? What feature of Microsoft
polet [3.4K]

Answer: Mail Merge

Explanation:

The feature of Microsoft Word that allows an individual to efficiently create documents that have the same general

content but may have different recipients or purpose is referred to as the Mail Merge

It should be noted that other options such as Send Merge, Print Merge and View Merge is wrong. Therefore, the correct option is A

5 0
2 years ago
The Operating System is used to locate, move, and copy files.
Temka [501]

Answer:

Yes!! the operating system is used to locate, move, and copy file

7 0
3 years ago
9.
Liula [17]

Answer:

128 is ur answer

Explanation:

please mark me as brainilist

5 0
2 years ago
Megan owns a small neighborhood coffee shop, and she has fifteen employees who work as baristas. All of the employees have the s
nlexa [21]

Answer:

she gives 10 dollars an hour

Explanation:

no

4 0
2 years ago
What commonly predefined alias is configured to run the ls âl command?
coldgirl [10]
<span>The l</span><span>l command is the commonly predefined alias that is configured to run the ls âl command. The command ls stands for list. So instead of writing list, in Linux you only write the command ls.
The alias are </span>shortcuts and time-savers. By typing ll we'll get the current directory's listing, in long format, including hidden directories.


6 0
3 years ago
Other questions:
  • Extend the flow properties and definitions to the multiple-source, multiple- sink problem. Show that any flow in a multiple-sour
    13·1 answer
  • Match each storyboarding technique with its appropriate description
    9·1 answer
  • The overall visual look of a chart in terms of its graphic effects, colors, and backgrounds is the:
    5·1 answer
  • pDevices used to prevent data from being written to a disk can connect to a computer through FireWire, SATA, PATA, and SCSI cont
    10·1 answer
  • Which command can be used to find errors on a hard drive​
    6·1 answer
  • What are the differences, physically and logically, between the two printing configurations: Network-attached Printing and Netwo
    7·1 answer
  • Define<br>output<br>devices<br>.<br>Give<br>any<br>three<br>examples<br>.<br>3.​
    8·2 answers
  • ________ are chunks of software - installed on one's computer, tablet, or smartphone - that are gateways to games, online resour
    8·1 answer
  • What is your impression on the subject fundamentals of database systems?​
    7·1 answer
  • What is the remainder obtained by dividing x 7 + x 5 + 1 by the generator polynomial x 3 + 1?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!