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
Tanya [424]
3 years ago
12

Assume you have a variable sales of type Money where the latter is a structured type with two int fields, dollars and cents. Wri

te a statement that reads two integers from standard input, a dollar amount followed by a cents amount, and store these values in the appropriate fields in sales.
struct Money
{
int dollars,cents;
};

int x,y;
cin>>x>>y;
sales.dollars= x;
sales.cents= y;
Computers and Technology
2 answers:
7nadin3 [17]3 years ago
8 0

Answer:

The answer to the question is included in your question. I guess you need an explanation or clarification.

See Explanation Below

Explanation:

struct Money

{

int dollars,cents;

};

int x,y;

cin>>x>>y;

sales.dollars= x;

sales.cents= y;

The code segment is written in C++ programming language

On Line 1 of the code segment;

The struct keyword is used in c++ and other c type programming to define structure. The name of the structure is Money.

It defines a data type such that the data type is a collection of system and user defined data types

The Money structure defines two integer variables; dollars and cents on line 3.

On line 6, two integer variables x and y are declared.

On line 7, the two variables received inputs from the user.

On line 8, the value of variable x is assigned to dollar

On line 9, the value of variable x is assigned to cent

Nuetrik [128]3 years ago
3 0

Answer:

int x,y;

cin>>x>>y;

sales.dollars= x;

sales.cents= y;

Explanation:

The answer is already part of the question.

First, integer x and y is declared. Then, x and y is received via the standard input. Then x is assigned to sales.dollars while y is assigned to sales.cents.

You might be interested in
In the last two decades, how have cameras evolved?
Artist 52 [7]

Answer:

The Changes to Camera Technology over the last 70 years. The technology that the modern camera is based on was created several hundred years ago. ... The company would then reload the camera with new film and send it back to the consumer so they could take more pictures with it.

Explanation:

8 0
3 years ago
Read 2 more answers
Create a Python program as described below and save it in a file named bool. You should use IDLE or similar environment to creat
Eva8 [605]

PYTHON CODE

# function to compare a and b
def compare(a,b):

    # if a is greater than b , return 1
    if a > b:
        return 1

    # if a and b are equal, return 0
    elif a == b:
        return 0

    # if a less than b , return -1
    elif a < b :
        return -1


# testing
if __name__=="__main__":

    # calling the compare function with a and b
    print('compare(5,2) %d'%compare(5,2))
    print('compare(2,5) %d'%compare(2,5))
    print('compare(3,3) %d'%compare(3,3))

    # getting values for a and b
    a=int(input("Enter the value for a: "))
    b=int(input("Enter the value for b: "))

    print('compare(%d,%d) %d'%(a,b,compare(a,b)))

(see attachment for output)

8 0
2 years ago
6
Novosadov [1.4K]

Answer:

government and New Zealand

Explanation:

you can see the web site name the name is gov.nz ,gov mens- government and nz means new Zealand

thank you like us

8 0
2 years ago
Read 2 more answers
What are five don’ts of using a computer
Sonja [21]

Answer:

well, as long as there are no right or wrong answers, don't:

look to closely at the screen, as it may mess up your eyes

hold a drink above the computer, as it may spill and cause "sticky keys"

go to sites that you know will give your a computer a virus, cause they cost hundreds of dollars to repair, and some aren't able to come out

go on illegal sites/do illegal operations to the computer itself, because then you won't have a computer

Explanation:

3 0
2 years ago
Read 2 more answers
Select the steps for adding artwork into a placeholder on a presentation slide
Sloan [31]

Answer:

   Open the presentation that you want to add a slide to.

   In the pane that contains the Outline and Slides tabs, click Slides, and then click where you want to add a slide.

Explanation:

6 0
3 years ago
Other questions:
  • Write a MIPS program to continuously generate the following series of integers: 1, 2, 3, 6, 9, 18, 27, 54, 81, and so on. Use st
    13·1 answer
  • Codio Challenge Activity PythonWe are passing in a list of numbers. You need to create 2 new lists in your chart, then put all o
    13·1 answer
  • Given four values representing counts of quarters, dimes, nickels and pennies, output the total amount as dollars and cents. Out
    10·1 answer
  • P3. In Section 4.2 , we noted that the maximum queuing delay is (n–1)D if the switching fabric is n times faster than the input
    8·1 answer
  • A smart refrigerator can use what to detect when you are running low on milk, and then send a reminder to you on a wireless.
    8·1 answer
  • Secops focuses on integrating the need for the development team to provide iterative and rapid improvement to system functionali
    14·1 answer
  • Complete the statement below using the correct term.<br>Website managers use<br>every day​
    11·2 answers
  • How can we avoid falling victim to a phishing or pharming scheme
    14·1 answer
  • Distributed databases and data warehouses would be considered which data model type?
    9·1 answer
  • Which digital cellular standard is used widely throughout the world except the united states?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!