Solved

C++

Posted on 2000-04-08
10
160 Views
Last Modified: 2012-05-05
I need to write a program that takes a number & produces the multiplication table up to the user specified number.
a) I must create a function named multiples that takes two numbers as input arguments and returns a void. The first argument is the number for which multiples are to be produced. The second argument is the number of multiples that should be produced. The function will print a line of multiples.
b) Finally, The main function should:
- prompt the user to enter a value.
- use a for or a while loop to step through the values from 1 through the user specified value.
- from the body of the loop, invoke the function created in step a to print a line of output.
I want to include al the variable declarations & the program must run.
I'm obviously brand new to this, but now that I'm retired, I thought it would be fun to learn! oops! I completely lost. Can anyone show me examples and guide me through this?
0
Comment
Question by:rtb8288
  • 3
  • 2
  • 2
  • +3
10 Comments
 

Expert Comment

by:vinodkarande
ID: 2695894
Dont mind , but u should at least make some efforts from ur side.....
This is a Exchange-experts site....this site is basically concerned with exchanging opinions on ur incomplete work if ur facing some props.....

I think u should first start implementing the code.....and then ask for some advice if ur facing some props.

regards,
Vinod
0
 
LVL 1

Expert Comment

by:ntdragon
ID: 2695909
we don't do homework
if you have any problem with it ask a question or send us your code and tell us your problem
0
 
LVL 22

Expert Comment

by:nietod
ID: 2695910
We cannot provide answers to school assignments.  That is grounds for removal from this site.  (for both you and the experts involved.)  We can provide only limitied help in accademic assignments.    We can answer specific (direct) questions, like you might ask your teacher.  We can review your work and post suggestions, again, like your teacher might do.

Do you have specific questions?
Do you have any work on this (incomplete even) that we can review?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 10

Expert Comment

by:RONSLOW
ID: 2696063
show us what you have so far (working or not).

here's a little starter if you've gotten absolutely nowhere

>a) I must create a function named multiples that takes two numbers as input arguments and returns a void. The first argument is the number for which multiples are to be produced. The second argument is the number of multiples that should be produced. The function will print a line of multiples.

void multiples (int base, int nmultiples) {
  ...
}

in the function start with multiple = base, then loop thru n-multiple times
each time multiplying multiple by base and outputing multiple using cout.

>b) Finally, The main function should:
>- prompt the user to enter a value.

easy .. write the prompt with cout << and input with cin >>

>- use a for or a while loop to step through the values from 1 through the user specified value.

for loop sounds best .. pretty obvious.

>- from the body of the loop, invoke the function created in step a to print a line of output.

not much there either.

Post your attempted code and wecan help with it.
0
 

Expert Comment

by:levkin
ID: 2735339
He-he Computer Science 101
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 50 total points
ID: 2743221
Well , i think I've helped enough.
0
 

Author Comment

by:rtb8288
ID: 2744195
RONSLOW'S HELP WAS SUPERB; ABOVE AND BEYOND THE CALL OF DUTY!
0
 
LVL 22

Expert Comment

by:nietod
ID: 2744493
Then you should grade his answer and close the question.
0
 

Author Comment

by:rtb8288
ID: 2744810
I've attempted to close the question; I've also attempted to remove myself from the EE list, both unsuccessfully. Please close the question & remove my email address from the list.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2744864
To close the question, select one of the grades (A-D) that you think RONSOW deserves.  Then press the submit button.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

790 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question