Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ with comments please. Thank you! 3 33 1. Write a program that prompts the user to input an integer number n determine if

In C++ with comments please.
Thank you!
image text in transcribed
3 33 1. Write a program that prompts the user to input an integer number n determine if n is a prime number or not, and calculate the sum of cubes: 1 +2+... The output (if 3) should be like: Number 3 is a prime number The output (if-4) should be like: Number 4 is not a prime number 2. Write a program, ask the user to input a number and generate the following outputs: 2) if-3 3) if Attention, the above is an example, n could be any integer 3. Given the following table which contains the information of some battleships in World War II, create a structure to store the information, and do the following tasks (each one with a function); a) ask the user to input the information into an array of structure. b) display the ships as the original order, c) calculate the average values for numGuns and displacement, and display the result. NUMGUNS TYPE bb bb be bb COUNTRY Germany USA Japan USA BORE 15 16 9 8 NAME Bismarck Towa Kongo North Carolina Renown Revenge Tennessee Yamato DISPLACEMENT 42000 46000 32000 37000 16 be bb bb bb Gt Britain Gl. Britain USA Japan 6 8 12 9 13 15 14 18 32000 29000 32000 65000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional Microsoft SQL Server 2014 Administration

Authors: Adam Jorgensen, Bradley Ball

1st Edition

111885926X, 9781118859261

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago