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
____ [38]
2 years ago
7

Write a function NumberOfPennies() that returns the total number of pennies given a number of dollars and (optionally) a number

of pennies. Ex: 5 dollars and 6 pennies returns 506.
Sample program:
#include
using namespace std;

int main() {
cout << NumberOfPennies(5, 6) << endl; // Should print 506
cout << NumberOfPennies(4) << endl; // Should print 400
return 0;
Computers and Technology
1 answer:
Over [174]2 years ago
4 0

Answer:

Following are the code to the given question:

#include <iostream>//header file  

using namespace std;

int NumberOfPennies(int ND, int NP=0)//defining a method that accepts two parameters  

{

return (ND*100 +NP);//use return keyword that fist multiply by 100 then add the value  

}

int main() //main method

{

cout << NumberOfPennies(5,6) << endl; // Should print 506

cout << NumberOfPennies(4) << endl; // Should print 400

return 0;

}

Output:

506

400

Explanation:

In the method "NumberOfPennies" it accepts two parameters that are "ND and NP" that uses the return keyword that multiply 100 in ND variable and add in NP variable and return its values.

In the main method it it uses the cout method that call the by accepts value in parameter and print its value.

You might be interested in
what will be the Trade discount and Invoice Amount if the List Price is $400.00 and the Trade Discount Rate is 85%
V125BC [204]

Answer:

$340

Explanation:

you have to multiply $400 bu 85% to get $340

4 0
2 years ago
A program that will ring a bell six times is what kind of program?
amm1812

Answer:

D

Explanation:

because it is a sequence it does more than one thing

6 0
3 years ago
Read 2 more answers
The Mark Table of Contents Entry option is used for marking nonheading text for the table of contents. the options are manually
enyata [817]

Answer:number 1

Explanation:asian culture

5 0
2 years ago
Read 2 more answers
__ means having a current knowledge and understanding of computers, mobile devices, the web, and related technologies.
Brrunno [24]

Answer:

Digital literacy

Explanation:

Digital Literacy means having a current knowledge and understanding of computers, mobile devices, the web, and related technologies.

Brainliest plz

8 0
3 years ago
Which type of financial institution typically has membership requirements?
dedylja [7]
I would say at least banks and credit unions.Membership requirements could include such things as having significant assets to open a certain type of account, having accounts in other branches, being willing to have a certain prescribed amount of membership shares such as at some credit unions.
4 0
3 years ago
Other questions:
  • The number of operations executed by algorithms A and B is 40n2 and 2n3, respectively. Determine n0 such that A is better than B
    12·1 answer
  • HELPPP ASAPP
    8·2 answers
  • What is ment by creative middle way solution
    6·1 answer
  • HELP QUICKLY!!! IF YOUR RIGHT I'LL MARK YOU BRAINLIEST
    15·2 answers
  • Create a text file named employee.dat containing the following data: b. Write a C++ program to read the employee.dat file create
    6·1 answer
  • The 'WIMP' environment is much more user friendly,why?​
    11·2 answers
  • 2. The Warren Commission investigated the assassination of President _______________________ in 1964.
    6·1 answer
  • Which of the following formats can algorithms NOT be written in:
    8·2 answers
  • I need the full code for 6.1.3 code hs circles and squares please answer please help
    12·1 answer
  • How do I make my header line visible?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!