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
Who is the father of computer ethics?​
IRINA_888 [86]

Answer:

<h3>Donn Parker Of SRI is the father of computer ethics.</h3>

Explanation:

Donn Parker of SRI, who is credited with being the "father of computer ethics" due to his interest during the 1960's with ethical concerns related to the newly emerging information technologies, defines computer ethics as the application of classical ethical prin- ciples to the use of computer technology 

3 0
3 years ago
What does the security element of non-repudiation mean in e-commerce cybersecurity? A. Data needs to be available at all times.
VARVARA [1.3K]

Answer:

Non-repudiation is the assurance that someone cannot deny the validity of something. Non-repudiation is a legal concept that is widely used in information security and refers to a service, which provides proof of the origin of data and the integrity of the data

Explanation:

8 0
3 years ago
Kyle is running out of disk space on his hard drive on a Windows XP Professional system. He has installed and configured a third
Varvara68 [4.7K]

Answer:

The answer is "Disk utility".

Explanation:

It'll work well go over to Disk utility before updating the drivers like diskmgmt.msc throughout the Running box, or right-click Device icon, and pick Manage. Click Rescan Disks on the key decision-makers. It's not essential to reconnect until the machine recognizes the latest disc.

  • In each disc setup as storage properties is a reactive drive. Almost every dynamic disk is separated into quantities.
  • It is the season, spanned, and strip volume forms will be included.
5 0
3 years ago
Read 2 more answers
How to solve this?<br> In c++
andrey2020 [161]

Explanation:

6* 49 because you multiply the number of dots in the first figure by 49

8 0
3 years ago
What are Important advice to include about spyware, viruses, and other types of malware?
Contact [7]
They can corrupt data giving away confidential information, which in some cases is a violation of customer privacy and should be taken very seriously. Also it can slow the machine down exponentially. Some malware can delete files required for the machine to run and ultimately render it useless.
3 0
3 years ago
Other questions:
  • What are pixels that are the exact same between multiple frames called?
    15·1 answer
  • What is the purpose for adding images and graphics to a web page?
    5·1 answer
  • A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a se
    10·1 answer
  • The capacity of a communication channel is measured in _______.
    6·2 answers
  • According to the Center for 21st Century Skills, critical thinking ability includes all of the following skills, EXCEPT ______.
    5·1 answer
  • True or false.local and cloud backup differs in where the backup is saved
    15·2 answers
  • How do I write the yearly salary for something without copying it word for word? I'm doing a PowerPoint ( which you had to choos
    15·1 answer
  • Refer to the method f: Public int f( int k, int n ) { if( n == k ) return k; else if( n &gt; k ) return f( k, n - k ); else retu
    8·1 answer
  • You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful subnet mask would you use?A. 255.25
    12·1 answer
  • Putting commands in correct order so computers can read the commands
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!