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
fomenos
3 years ago
8

Assume that price is an integer variable whose value is the price (in US currency) in cents of an item. Write a statement that p

rints the value of price in the form "X dollars and Y cents". So, if the value of price was 4321, your code would print "43 dollars and 21 cents". If the value was 501 it would print "5 dollars and 1 cents". If the value was 99 your code would print "0 dollars and 99 cents".
Computers and Technology
1 answer:
aivan3 [116]3 years ago
3 0

Answer:

// here is program in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int price;

cout<<"enter the price: ";

// read the price

cin>>price;

// find the dollars

int doll=price/100;

// find the cents

int cent=price%100;

// print the dollars and cents

cout<<doll<<" dollars and "<<cent<<" cents.";

return 0;

}

Explanation:

Read the price from user and assign it to variable "price".Then find the dollars by dividing the price with 100 and to find cents calculate modulus 100 of price. Then print both the value.

Output:

enter the price: 4321                                                                                                      

43 dollars and 21 cents.

You might be interested in
Read an integer from keyboard and then print the result of the sum obtained by adding the entered integer to the integer formed
Stels [109]

Answer:

Following are the program in C++ language

#include <iostream> // header file

using namespace std; //  namespace std;

int main() // main function

{

int number,n1,rem; // variable declaration

int sum,sum1=0;// variable declaration

cout<<"Enter the number :";

cin>>number;// Read the number

n1=number; // initialized the value of number with the n1

while(n1>0) // iteating the  while loop

{

   rem=n1%10; // finding the reminder

   sum1=10*sum1+rem;  // storing the sum

   n1=n1/10;

}

sum=sum1+number; // calculate the sum

cout<<"The sum is:"<<sum; // Display sum

   return 0;

}

Output:

Enter the number :123

The sum is:444

Explanation:

Following are the Description of the Program

  • Read the value of "number" in the "number" variable of int type .
  • Initialized the value of "number" in the "n1' variable.
  • Iterating the while loop until the n1>0.
  • In this loop we reverse the number in the "sum1" variable
  • Finally print the sum in the "sum" variable

3 0
3 years ago
HELP PLX ITS PYTHON BTW!!!
ExtremeBDS [4]

Answer:

Sebastian is your last name diaz

Explanation:

Functions allow us to break our program into multiple parts

Multiple is the answer

Atlanta-Robinson

5 0
3 years ago
You are starting a small web hosting business and
Studentka2010 [4]

Answer:

otp

Explanation:

don't know bro ask to your teacher

7 0
2 years ago
An ______ search is when the buyer looks for information beyond personal knowledge to help make the buying decision, such as che
victus00 [196]

Answer: External

Explanation: External search could be explained as the additional information gathered beyond an individual's personal knowledge or experience in a bit to influence the individual's decision on a particular product or topic. This additional information could include; information sought from friends and families, online or internet research on relevant site, blogs or publications.

Therefore, a buyer who asks a friend, checking the internet or visiting a showroom or make other enquiries beyond his personal knowledge in other to make buying decision is making an external search.

6 0
3 years ago
How do you fix this windows 7 screen​
tensa zangetsu [6.8K]

Try restarting it. If you can’t restart because the screen is frozen maybe just turn it off and back on. If you already tried restarting and it still didn’t fix the problem, just give it some time. The computer will reset itself eventually which should fix the problem.

6 0
3 years ago
Other questions:
  • Explain how to use fortran programming in details
    14·1 answer
  • DHCP and FTP servers listen for and send network traffic on:
    5·1 answer
  • Chdtp aoxophg gr72 ae9&gt;3 zqqz
    12·1 answer
  • Which key is used in word processors to create indentations?
    13·2 answers
  • Are the actions legal or illegal?
    13·1 answer
  • Google Glass uses a projector that bounces a beam of light off a prism and projects the image directly on your ________. field o
    14·1 answer
  • What method is used to manage contention-based access on a wireless network?
    7·1 answer
  • Which of the following is an example of an output device
    13·1 answer
  • A programmer has an idea to use just one language for the content, structure, and style of web pages. What might be a problem wi
    11·1 answer
  • Which web browser was created by Google?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!