someone pls help me this is my final assignment and i dont know how to do it PLS PLS

Write a C++ program that displays a calculation menu as shown below:

Calculation Menu

1. Multiplication Table
2. Prime Number
3. Sort Numbers
4. Quit

For examples:

If the user enters 1, the program should ask to enter one integer value from 1 to 12 and then display the following multiplication table:

Example :
If input : 7
The output that will be displayed :
Muliplication of 7
1 X 7 = 7
2 X 7 = 14
.
.
.
12 X 7 = 84
If the user enters 2, the program should ask to enter a set of N integers. Find the total number of prime numbers in the list of data entered. Given below is an example of an algorithm to find a prime number.

Pseudocode
Mula
Kira <- 0
Baca N
Ulang
Baca Nom
Kira  Kira + 1
BilBolehBahagi 0
Pembahagi  0
Ulang
Pembahagi  Pembahagi + 1
Jika Baki(Nom/Pembahagi)=0 Maka
BilBolehBahagi BilBolehbahagi + 1
Sehingga (Pembahagi=Nom)
Jika BilBolehBahagi = 2 Maka
BilPrimeNo BilPrimeNo + 1
Sehingga (Kira=N)
Cetak BilPrimeNo
Tamat


If the user enters 3, the program should ask to enter a series of N integers and sort the numbers in ascending order.

The program must be able to prompt the user to make several calculation selections until the user enters 4, if the user wants to stop processing.
Display an error message if the user enters a number outside the range of 1 through 4 when selecting an item from the menu.


The program’s main is to contain only call statements. At least 3 sub-functions are required: one to calculate multiplication of numbers, one to determine the number of prime numbers, and one to sort numbers in ascending order. For each subfunction call at least two another subfunctions.










Output must be well presented.
What to do :
1. Date due for submission: 2 weeks time
2. Submit CD + report together with external documentation( Flowchart or pseudo code)
3. Report must be well presented

Additional information:
• Prompt user for input
• Comments should appear in the program to:
◦ Explain the purpose of the program
◦ Identify who wrote it
◦ Explain the purpose of particular statements
Last edited on
Which part did you need help with ?
most of it
i really dont know how to do it
If you don't try then you deserve to fail.

Show me some work and lets get started.
i really dont know where to start
Write a C++ program that displays a calculation menu as shown below:

- You should use the switch statement ( http://www.cplusplus.com/doc/tutorial/control/)

For examples:

If the user enters 1, the program should ask to enter one integer value from 1 to 12 and then display the following multiplication table:

Example :
If input : 7
The output that will be displayed :
Muliplication of 7
1 X 7 = 7
2 X 7 = 14
.
.
.
12 X 7 = 84


To give you an idea,
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>


int main()
{
	const int maxSizeMult{ 12 };

	std::cout << "User input : ";
	int userIntValue{};
	std::cin >> userIntValue;
	std::cout << "Multiplication of " << userIntValue << std::endl;

	for (unsigned int count = 0; count < maxSizeMult; count++)
	{	
		int result{};
		result = (count + 1) * userIntValue;
		std::cout << count + 1 << " X " << userIntValue 
			<< " = " << result << std::endl;
	}

	return 0;
}


If the user enters 2, the program should ask to enter a set of N integers. Find the total number of prime numbers in the list of data entered.

Just some google search...

https://www.geeksforgeeks.org/sieve-of-eratosthenes/

The program’s main is to contain only call statements. At least 3 sub-functions are required: one to calculate multiplication of numbers, one to determine the number of prime numbers, and one to sort numbers in ascending order. For each subfunction call at least two another subfunctions.


http://www.cplusplus.com/doc/tutorial/functions/

Hopefully, it should give you an idea on how to begin writing the program. If not, then you may want to reconsider changing your degree plan in school.
im sorry i still dont know how to do this program
Last edited on
The "show table", "find primes", and "sort numbers" are independent tasks. They can be written independently. The "menu" in main is independent too. You can write most of it even if you don't have functions to call.


You did state that this is your "final assignment". Therefore, you should not have any excuse for "I don't know".
Your professor gave you some tasks that you should do, that have nothing to do with writing code. This is only the last step.

First:
2. Submit CD + report together with external documentation( Flowchart or pseudo code)

Break the problem down into smaller sets of problems.
Do some maths on paper, for instance how do you find prime numbers.

Second:
If you are able to work this out, try to find which data types your program may need.
Do you need double, float, integers, something else?

What else does your program need?
Arrays, vectors?
Do you need loops? Which ones?

What should be input?
What should be output?

Try to find possible functions.
Define what they should do.
Define which data type(s) they accept, if any.

Define whether any of the functions should return something.
In case of multiple functions, how should they interact?
Determine which function calls which.

Then, write pseudo-code, (or actual code), for the smaller problems you are condifent you can solve. In the end, when writing code, combine what works, and see if it works in conjunction with everything else in your actual program.

If you aren't able to do at least this, then you are likely to fail your course. (Unless you find someone who does all the work you should be doing. Again, you will fail, because you never learn problem solving skills, much less how to write a program on your own.)
Last edited on
i guess i'll just give up then
The link below may help you on how could the output of the program look. It should give you hints on how to write the requirements that @Misenna was telling you about.
https://youtu.be/T36Ph2rNTHM?t=1m
Why are you even taking this class? I remember last semester where you asked the community to do your whole assignment for you, which they did. I thought you would at least go ahead and try to learn something, but it seems that you have done the complete opposite. You always seem to put it off until the very last minute and then asking us to do it for you again. It seems you don't even grasp the basics of c++ let alone any sort of programming. I am assuming you are studying some kind of engineering at University. For what reason are you studying then? Just because you're handed a piece of paper doesn't mean you're an engineer. I think it's time to change majors. This isn't getting you anywhere in life.
Last edited on
Topic archived. No new replies allowed.