473,581 Members | 2,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help, i don't know how to make a good title!

2 New Member
Need someones help , I am having a very difficult time understanding parameters and functions, can someone help me answer these questions

1. Write a program that helps an elementary school student learn multiplication. Use rand to produce two positive one-digit integers. It should then type a question such as

How much is 6 times 7?

The student then types the answer. Your program checks the student's answer. If it is correct, print "Very good!", then ask another multiplication question. If the answer is wrong, print "No. Please try again.", then let the student try the same question repeatedly until the student finally gets it right.


2. Write a program that tells what coins to give out for any amount of change from cent to 99 cents. For example, if the amount is 86 cents, the output would be something like the following:

86 cents can be given as
3 quarters(s) 1dime(s) and 1 penny (pennies)

Use coin denominations of 25 cents (quarters), 10 cents (dimes), 5 cents (nickel), and 1 cent (pennies). Do not use half-dollar coins. Your program will use the following function (among other functions that you create):

void computeCoin (int coinValue, int& number, int& amountLeft);

For example, suppose the value of the variable amountLeft is 86. Then, after the following call, the value of number will be 3 and the value of amountLeft will be 11 (because if you take three quarters from 86 cents, that leaves 11 cents):

computeCoins (25, number, amountLeft);

Include a loop that lets the user repeat this computation for new input values until the user says he or she wants to end the program. (Hint: Use integer division and the % operator to implement this function).

3. Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions:

double getScore() should ask the user for a test score, return the variable as a return type and validate it. This function should be called by main once for each of the fives scores to be entered. (Input Validation: Do not accept test scores lower than 0 or higher than 100).

void calcAverage() should calculate and display the average of the four highest scores. This function should be called just once by main, and should be passed the five scores.

int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, who uses the function to determine which of the five scores to drop.

4. You will modify program number 3 so that the function called double getScore() will ask for all test scores and return the answers through reference variables rather than a return value. This is what the prototype will look like for this modified function -- void getScore(double &, double&, double&, double&, double&).
Nov 25 '07 #1
1 2817
Ganon11
3,652 Recognized Expert Specialist
The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

Please read the Posting Guidelines and particularly the Coursework Posting Guidelines.

Then when you are ready post a new question in this thread.

MODERATOR
Nov 25 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1668
by: Farooq Khan | last post by:
hi, my development team has been assigned a project that involves writing our own Web service. i happen to be a C++ programmer, new to C#/ASP.net. i dont know where to begin with......any article/book/link or anything that can help me start coding/getting those concepts, will be appreciated. Thanx, Farooq Khan
2
301
by: Pavel Novotny | last post by:
H I'm trying to import a | seperated text from string variable which represents a tabl with several fields, eg 6124079|PRIRUBA 11 DN250 PN6;CSN131160.0;11369.1;CSN131005.50|KS|11,100000|3437, 6124080|PRIRUBA 11 DN200 PN6;CSN131160.0;11369.1;CSN131005.50|KS|8,870000|2761, I dont know how convert it to dataset or XML... Is there any...
0
1308
by: arunavlp | last post by:
hi, I am new to .net , i am using VB.Net (Web form). I dont know how to pass parameters to stored function. Regards, Arun.S
2
2703
by: hojjatnikan | last post by:
please help me this code 62EH&5gx0wiqoQFw is this name ( Belux) but i dont know how convert it i dont know the algorithm of this code plead help me
2
2487
by: Tiruak | last post by:
Hi there. Thanks in advance for the people reading and trying to help. I'm very begginer using flash and action script, and I tryed to do this one navigation menu. Since I dont have experience doing this, I did things in a way I thought it should work, to create the onmouseover animation of the buttons of my navigation menu. After a couple...
2
5584
by: Sreenivas | last post by:
I dont know how to compile cpp programs with gcc as i am new to gcc and cpp. could anybody help me out? Thanks&Regards, Srinivas Reddy Thatiparthy.
2
1505
by: shwetaT | last post by:
i m working in php domain and i dont know much about php,so will u plz suggest me some good sites through which i learn php very well n fast
8
5672
risk32
by: risk32 | last post by:
Hi all. I have a really confusing problem. I'm using Swing and I'm trying to do a confirmation box : int reply; String message = "Do you want to input another number?"; String title = "Input Another Number?"; reply = (JOptionPane.showConfirmDialog(null, message, title, JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.NO_OPTION) {...
2
2042
by: sailormoon | last post by:
this information i put in data.txt 11221 MOHD IRFAN 80 70 11222 NURUL FITRAH 80 90 11223 MOHD FARHAN 70 80 11224 WAFFIN WARDAH 80 60 11225 SYAMSUL 50 50 99999 TAMAT 0 0 #include<fstream.h>
0
7876
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7804
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8156
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7910
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3832
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.