Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write C++ programs to perform the following tasks. In many of the program descri

ID: 3788393 • Letter: W

Question

Write C++ programs to perform the following tasks. In many of the program descriptions below, example input and output is provided. NOTE: You don’t need arrays to solve any of these problems. You should NOT use arrays to solve any of these problems. You should also not use string manipulation beyond extraction from an std::stringstream, if needed.

exclusive.cpp: Let the user input an odd number of positive integers, space separated, on a single line (as seen below). Assume that each integer except for one, the exclusive integer, appears an even number of times in the input. Your program should output the exclusive integer. Remember, you do not need nor should you use an array to solve this problem. You should also not use string manipulation beyond extraction from an std::stringstream, if needed.

primesum.cpp: Let the user input a single integer n where 1 n 100000. Your program should print the sum of the first n prime numbers. Remember, you do not need nor should you use an array to solve this problem. In the first example below, the first 5 prime numbers are 2, 3, 5, 7, and 11.

armstrong.cpp: Write a program that prints out all Armstrong numbers, each on their own line. An Armstrong number is a three digit integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 33 + 73 + 13 = 371. Remember, you do not need nor should you use an array to solve this problem.

bitsum.cpp: Let the user input a single integer n where 1 n 18446744073709551615. Your program should print the number of 1 bits in the binary representation of n. Remember, you do not need nor should you use an array to solve this problem. In the example below, the binary representation of 115 is 1110011. Remember, you should not use string manipulation beyond extraction from an std::stringstream, if needed.

endtime.cpp: Write a program to read two integers with the following significance. The first integer value represents a time of day on a 24 hour clock, so that 1245 represents quarter to one mid-day, for example. The second integer represents a time duration in a similar way, so that 345 represents three hours and 45 minutes. This duration is to be added to the first time, and the result printed out in the same notation, in this case 1630 which is the time 3 hours and 45 minutes after 12.45.

Explanation / Answer

primesum.cpp:

armstrong.cpp:

bitsum.cpp:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote