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
What is the purpose of using variables in programming?
Sedbober [7]
Variables are used to store information to be referenced and manipulated in a computer program. ... It is helpful to think of variables as containers that hold information. Their sole purpose is to label and store data in memory. This data can then be used throughout your program.
6 0
3 years ago
What do u call a individual that loves motor bikes and leather and is in a rival group known as mods?
vladimir1956 [14]
My best guess would be a biker they love motor bike they wear leather jackets and ride in groups this is the only thing i could think of

~ thanks ~
7 0
3 years ago
When writing test methods, what functionality is verified by the system method "runAs()"?
olchik [2.2K]

Answer:

The main functionality verified by this test method command is user sharing record.

Explanation:

Generally, every apex code runs in system mode.

Apex is strong object-oriented programming language that allows the developers to execute flow and transaction control.

Using syntax which look like java and acts as databases, Apex allows the developer to add any type of business logics to an event which can include button, clicks records or visual pages.

Apex code can be initiated by web service request.  

The permissions and record sharing of current user are not consider by apex codes.

Now the system method runAs() will allow you to take or write a test method which will basically change the user context to an existing or an new user, so that the record sharing will take place.

runAs() command will not change or anything done with user permissions or permission levels, it will only record sharing of the user.  

When you use runAs() command the original and true context will run after the test method is once completed under the command of runAs().

The runAs() has no concern with the user license.  

If there is no or expired your personal or organization license you can just make a new user with this runAS() command.

In using this command we have to make a private class by the name of this test and then our further code to make a user , afterwards  which we will the true and original code of ours which we want to run.

There are many other uses of runAs() like  

 Mixed DML operations in test by opening the DML operations.

 We can also use it as a version which will take a package as a version argument. This will cause the code a specific version.

runAs(System.Version) is the command used for this.

4 0
3 years ago
A proper divisor of a positive integer $n$ is a positive integer $d &lt; n$ such that $d$ divides $n$ evenly, or alternatively i
juin [17]

Answer:

The program written in Python is as follows:

<em>See Explanation section for line by line explanation</em>

for n in range(100,1000):

     isum = 0

     for d in range(1,n):

           if n%d == 0:

                 isum += d

     if isum == n * 2:

           print(n)

Explanation:

The program only considers 3 digit numbers. hence the range of n is from 100 to 999

for n in range(100,1000):

This line initializes sum to 0

     isum = 0

This line is an iteration that stands as the divisor

     for d in range(1,n):

This line checks if a number, d can evenly divide n

           if n%d == 0:

If yes, the sum is updated

                 isum += d

This line checks if the current number n is a double-perfect number

     if isum == n * 2:

If yes, n is printed

           print(n)

<em>When the program is run, the displayed output is 120 and 672</em>

4 0
3 years ago
Wedding photographers must be skilled at producing photographs that capture the
vampirchik [111]

Answer

True, BUT they can be trained.

Explanation:

4 0
3 years ago
Other questions:
  • A (blank) is a way for students to keep track of information during research
    7·2 answers
  • An excel user should use a relative cell reference when it is important to ____. preserve the relationship to the formula locati
    7·1 answer
  • What is the purpose of filters in a data base
    11·1 answer
  • Once artwork is inserted into a placeholder, it can be moved around on a slide. True False
    9·1 answer
  • Carbon copy others who are..
    14·2 answers
  • In an income statement subtracting the cost of goods sold from the net sales provides the?
    11·1 answer
  • Which branch of science helps avoid or minimize stress-related injuries at workplace?
    14·1 answer
  • Assert statements are a tool programmers employ to help them debug their code more efficiently.
    6·1 answer
  • What is white light?
    12·2 answers
  • Which directory contains the initrd file? in suse linux
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!