Solved

C++

Posted on 2000-04-08
10
158 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

786 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