Solved

C++

Posted on 2000-04-08
10
155 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 10

Expert Comment

by:RONSLOW
Comment Utility
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
Comment Utility
He-he Computer Science 101
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 10

Accepted Solution

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

Author Comment

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

Expert Comment

by:nietod
Comment Utility
Then you should grade his answer and close the question.
0
 

Author Comment

by:rtb8288
Comment Utility
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
Comment Utility
To close the question, select one of the grades (A-D) that you think RONSOW deserves.  Then press the submit button.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

744 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now