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]
3 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]3 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
Anybody know this? Read the following scenario. Using complete sentences, explain which part of the CIA triad has been broken. M
Sergio039 [100]

Answer:

Availability

Explanation:

3 0
3 years ago
What letter names the drive where windows most commonly stores data and files
Degger [83]

the (C:) drive is the default most of the time unless you go and change the partition letter.

5 0
3 years ago
When a job is sent to other countries, as many programming jobs have been, it is said to have been datamined.
OLEGan [10]
<span>When a job is sent to other countries, as many programming jobs have been, it is said to have been datamined. </span><span>
false</span>
6 0
3 years ago
BlueGriffon has four different views, called: Question 4 options: Normal, All Tags Mode, Source, and Preview.� WYSIWYG, HTML, So
daser333 [38]

Answer:

WYSIWYG, HTML, Source, and Preview in Browser

Explanation:

First, open the html file you are editing from the File : Open dialog, or from the Open File icon on the toolbar. Click on the toggle Browser Preview on the toolbar or from the View menu. This will give you a quick browser preview. Click on the button again and it will return to the code view

8 0
3 years ago
c724 wgu True or false. A storage device consists of all the components that work together to process data into useful informati
Law Incorporation [45]

Answer:

False

Explanation:

A output device consists of all the components that work together to process data into useful information

8 0
3 years ago
Other questions:
  • "a web server that is​ specially-built to manage and deliver business intelligence is called a​ _________."
    7·1 answer
  • When determining the cost of an item, the seller will often analyze the demand as well as the supply before setting the price of
    8·2 answers
  • Match the spreadsheet features with their respective descriptions.
    9·2 answers
  • Apache web server is the most widely used network operating system used on web servers.
    8·2 answers
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    6·1 answer
  • Why do nonprofit agencies include blogs on there website?
    10·1 answer
  • Which of the following is an example of an access object?
    9·1 answer
  • Help help help help​
    6·1 answer
  • বর্তমান করােনার ন্যায় পরিস্থিতি অর্থাৎ স্বাভাবিক শ্রেণি কার্যক্রম পরিচালনা সম্ভব
    10·2 answers
  • Which input and output pair is correct for a bicycle?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!