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
How to make a message appear in more than one slack channel
VMariaS [17]

Answer:

On your desktop, hover over the message you'd like to share and click the Share message icon on the right. Use the drop-down menu to choose where you'd like to share the message, and add a note if you'd like. Click Share to see the message expand.

Explanation:

7 0
3 years ago
You have installed a new sound card in your system, closed the computer case, and turned on the computer. Windows boots and you
ArbitrLikvidat [17]

The most likely problem which led to the lack of sound after the installation of the new sound card is that the '<em>sound card is not recognized or incompatible</em> '

  • The sound card is an hardware which is installed into a computer in other to allow the the system produce audio signal.

  • Without a sound card installed into a computer, then such computer would not be able to perform <em>audio</em> <em>input or produce audio signals</em>.

However, when a sound card is present and, the computer fails to produce audio signal, then the most likely problem is that, the <em>sound card installed isn't recognized</em>.

Learn more :brainly.com/question/25055825

8 0
2 years ago
Select the correct answer.
juin [17]

Answer:

A. <Title> tag

Explanation:

Required

Tag that can be written in the <head> element

Of the given options, <title> is correct.

This is so because, it is compulsory to have the <title> tag and the only location where it can be placed is inside the <head> tag.

Its function is to display the title of a page

e.g.

<em><title> This is my first page </title></em>

4 0
2 years ago
How do you take a picture on this app
damaskus [11]
The paper clip.

Hope this helped.

Can i have brainliest?
8 0
3 years ago
Identfy two duties of the governer stationed at mombasa under portugues rule?​
Tpy6a [65]

Answer:I got u

Explanation:

6 0
2 years ago
Other questions:
  • You can apply bold, italic, and underline styles to text. But why is it a good idea to use underline sparingly?
    13·2 answers
  • Big Data often involves a form of distributed storage and processing using Hadoop and MapReduce.
    12·1 answer
  • When you respond to an email from your bank that asks you to verify your account information, you may become a victim of a _____
    14·1 answer
  • To print a range of cells in the active worksheet, click ____ in the settings area in the print gallery.
    14·1 answer
  • One blog may have a greater social influence than another when it has_______?
    12·2 answers
  • Write a method called min that takes three integers as parameters and returns the smallest of the three values, such that a call
    13·1 answer
  • What is computer give definition ​
    14·2 answers
  • In Python, what does this command do:<br>print ("\n")​
    8·1 answer
  • TECHNICAL TERMS: the adderess of a website
    6·1 answer
  • What technology does kroger’s edge technology and amazon’s just walk out technology leverage?.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!