Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering


Wite a C++ function. A college offers a course that prepares students for the state licensing exam for real estate brokers.

Last year, ten of the students who completed this course took the exam. The college wants to know

how well its students did on the exam. You have been asked to write a program to summarize the

results. You have been given a list of these 10 students. Next to each name is written a 1 if the

student passed the exam or a 2 if the student failed.

Your program should analyze the results of the exam as follows:

Input each test result (i.e., a 1 or a 2). Display the prompting message "Enter result" each time the

program requests another test result.

Count the number of test results of each type.

Display a summary of the test results indicating the number of students who passed and the

number who failed.

If more than eight students passed the exam, print the message "Raise tuition."


Write a C++ program .A number is called a happy number, if you start with the given number

and arrive at 1 by repeating the following process (as illustrated in the below example):

(a) compute the sum of the squares of given number digits

(b) if the resultant value is 1, then the number is happy number, else execute point (a) for

the newly produced number.

Note that if a number is not a happy number, there will be an endless loop to this execution.

Goal: In this question, you are required to write a recursive function that checks whether

the number entered by the user is a happy number or not for 10 cycles/iterations only. The

output shown in blue colour should be shown by the function and text in yellow colour

should be displayed by the main function.

Enter a number: 19

Number Computation Result cycle/iterations

19 1 2 + 9 2 82 1

82 8 2 + 2 2 68 2

68 6 2 + 8 2 100 3

100 1 2 + 0 2 +0 2 1 4


I tried 19 for happy number

I tried 4 iterations.

19 is a happy number



write a C++ program.A number is called a happy number, if you start with the given number

and arrive at 1 by repeating the following process (as illustrated in the below example):

(a) compute the sum of the squares of given number digits

(b) if the resultant value is 1, then the number is happy number, else execute point (a) for

the newly produced number.

Note that if a number is not a happy number, there will be an endless loop to this execution.

Goal: In this question, you are required to write a recursive function that checks whether

the number entered by the user is a happy number or not for 10 cycles/iterations only. The

output shown in blue colour should be shown by the function and text in yellow colour

should be displayed by the main function.

Enter a number: 19

Number Computation Result cycle/iterations

19 1 2 + 9 2 82 1

82 8 2 + 2 2 68 2

68 6 2 + 8 2 100 3

100 1 2 + 0 2 +0 2 1 4


write a C++ program for a Semi-autonomous vehicle (Self-Driving Car) that has the

following requirements. Class name is Car that contains the following attributes.

• The name of car

• The direction of car (E,W,N,S)

• The position of car (from imaginary zero point)

• Create a rough Map of the way you come to school (e.g go east for x distance, go west

for x distance, etc) and use the class that you just created a function and pass in these

values and print the steps. For example, I turn west for 200m so it would print: “Moving:

West for distance: 200” (Translate the map into code)



Define a function named GetWordFrequency that takes a vector of strings and a search word as parameters. Function GetWordFrequency() then returns the number of occurrences of the search word in the vector parameter (case insensitive). 

Then, write a main program that reads a list of words into a vector, calls function GetWordFrequency() repeatedly, and outputs the words in the vector with their frequencies. The input begins with an integer indicating the number of words that follow. 

Ex: If the input is:

5 hey Hi Mark hi mark

the output is:

hey 1
Hi 2
Mark 2
hi 2
mark 2

Write a program to design a class complex to represent negative numbers. The negative class


should use an external function (use it as friend function) to add two negative numbers. The


function should return an object of type negative representing the sum of two negative


numbers.

Create a class Employee having basic its details like name, age, Salary etc. Let there be a function show details which will print all the values for the data members. Further, inherit the same class to create two different classes Developer and Manager.


Implement the concept of runtime polymorphism by invoking the show details function


A bookshop gives discount to customers as follows: • Students get 10% discount, • Book dealers get 12% discount and • Pensioners get 15% discount. • All other customers get 10% discount only if their total purchases are more than R200. You are requested to write two versions of a program that calculates and displays the final amount that is due, after discount. (i) The first version of the program uses a switch statement to implement the above program. (ii) The second version of the program uses nested-if statements. Hint: Use the following variables: float amount; // the amount due before discount char customer Type; // the type of customer: 'S' (student) or // 'D' (dealer) or 'P' (pensioner) or


Include the for loop below in a small program and complete the program. The loop should execute 10 times. Do not change the for loop below. Compile and run your program to see for yourself that it works. You do not have to submit this program and output. for (int i = 1; i <= n; i++) cout << i * i; Now convert the for loop into a while loop and add any variable initialisations that you think are necessary. Compile and run your program and submit only the program containing the while loop and its output


The Computer Science Department follows certain criteria when a student learns to program. A number of programming exercises must be worked through. To proceed to the next exercise a student has to obtain a mark of 50% or more and must have completed 5 or more program runs. You are requested to write a program to validate if a student can proceed to the next program. Your program should have the following structure: Declare two integer variables programs, Done and result. Validate the data captured for the two variables using a while loop. The loop should be repeated until the value of result is greater than or equal to 50 and the value of programs Done is greater than or equal to 5. • Display a message like "Good! You can now proceed to the next exercise" Submit both your program and output


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS