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
Where in an email would u find information about the action requirements​
Assoli18 [71]

Answer:When trying to find the action that you need to do in an e-mail, it is best to consult the body of the email, also known as (B) in the message.. The message would detail the tasks that you need to tackle, which are generally not detailed in the subject line, greeting, and you will most definitely not find in the to field.

Explanation:

3 0
3 years ago
NO LINKS Please
Kamila [148]

Answer:

ok po majsbejwwlaodhd susbvskwmoskwaubsbsiwnwis sisbsbsb is a good 2AM 2AM 2nd edition 2and I am a nanny 2and and u 2122feet 225feet to see how 2nd grade are you 22feet but not yet a lot more because it has alot of people who is the key to the girl in your life of your own life NATO is the most powerful and I was a great person in a sentence and a very nice meeting you had to do nothing babe and she had an affair in a way maker that I am in a relationship with u are in bed now babe and my mom and my dad a lot of my cousn and my kids in the morning and my kids were in the same boat and 5PM was the first of my two 5th grade boys in school to be with u at work now babe on my messenger then the Lord was in bed and she had no probs and no babe to be in Philippines and my kids had to be a good 58 and a little more because I was so happy bday sis had a lot to say about the girl and she was busy with me I will be having dinner with the kids on me sometime next time because she is very good at home now babe ruth is it ur wife is still single forever ni mama ne is a good girl also a big part in her to be the center babe if I will be a good person and I think they 5th 5 and 5 and u have a lot more to lose than me if u have a lot

6 0
2 years ago
Read 2 more answers
Develop a program that will calculate the area and perimeter of a rectangle. The length and width can be given as constant.(LENG
o-na [289]

Answer:

#include <iostream>

using namespace std;

int main()

{

 

  int length = 8;

  int width = 8;

 

  int perimeter = 2*(length + width);

  int area = length * width;

 

  cout<<"The perimeter is "<<perimeter<<endl;

  cout<<"The area is "<<area<<endl;

 

  return 0;

}

Explanation:

include the library iostream for using the input/output instructions in the c++ programming.

Create the main function and define the variable length and width with values.

Then, use the formula for calculating the perimeter and area of rectangle.

perimeter = 2*(length + width)

area = length * width

and store in the variables and finally print the output.

8 0
3 years ago
What are the raw materials for the process of photosynthesis​
Ray Of Light [21]
The raw materials of photosynthesis, water and carbon dioxide, enter the cells of the leaf, and the products of photosynthesis, sugar and oxygen, leave the leaf.
7 0
3 years ago
Read 2 more answers
Jerome falls sick after eating a burger at a restaurant. After a visit to the doctor, he finds out he has a foodborne illness. O
babunello [35]

Answer: food poisning

Explanation:

either the food wasnt

cooked properly or the food was out of date and went bad

3 0
3 years ago
Other questions:
  • Which keyboard feature is a form feed character?
    14·1 answer
  • Which of the following statements is false?
    10·1 answer
  • In addition to training on the products and on company policy, it does not make sense to be prepared to speak about your company
    6·2 answers
  • You can precede a subquery with the ___ operator to create a conditiion that is true if one or more rows are obstained when the
    10·1 answer
  • I have an LG phone. Since I just bought my phone, my bill to text message isn't paid yet. I texted a couple of things playfully
    5·2 answers
  • Select two netiquette guidelines. In a paragraph of no less than 125 words, explain why these guidelines make professional onlin
    9·1 answer
  • Exchanging which type of data uses the least bandwidth?
    7·2 answers
  • Given an array of integers and the size of the array, write a function findDuplicate which prints the duplicate element from the
    11·1 answer
  • Who can search the internet and select element base on important words
    13·1 answer
  • Someone please help will mark as brainliest
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!