Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Part 3 In C++ with comments.
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

Database Horse Betting The Road To Absolute Horse Racing 2

Authors: NAKAGAWA,YUKIO

1st Edition

B0CFZN219G, 979-8856410593

More Books

Students also viewed these Databases questions