C++ Answers

Questions answered by Experts: 9 913

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

In this task, you need to understand two algorithms which can be helpful, the Breadth￾First Search which utilizes the Queue data structure to find the shortest path and the 

Depth-First Search which can traverse a Stack data structures. 

Hint:

Develop a data structure similar to binary trees. Using a standard 8 X 8 chessboard, show 

the knight’s movements in a game. As you may know, a knight’s basic move in chess is 

two forward steps and one sidestep. Facing in any direction and given enough turns, it 

can move from any square on the board to any other square. 

If you want to know the simplest way your knight can move from one square (or node) to 

another in a two-dimensional setup, you will first have to build a function like the one 

below.

knight plays ([0,0], [1,2]) == [[0,0], [1,2]]

knight plays ([0,0], [3,3]) == [[0,0], [1,2], [3,3]]

knight plays ([3,3], [0,0]) == [[3,3], [1,2], [0,0]]


Find the length of the following strings

char str1[] = "I love C+++ Programming! ";

char str2[] = "This is so cool!";

char str3[] = "Good job learner!";

The output should be like the following format:

The length of str1 is __

The length of str2 is __

The length of str3 is __


Write a C program to implement the following equations:

                  a) 2x5 - 3x4 + 5x3 - 3x2 + 7x – 9

 Where x is the user defined value.

                  b) x3sin(tan(45)) + 4x + 7cos(90x2)

Where the value of x is a floating point number provided by the user.


Write a c++ program to calculate Gross salary(net salary+DA+TDS) for 4 employees where overload the +

operator for getting the total salary obtained by all the 4 employees. Also get the average salary of employees

by operator overloading. display all the details of all four employees. Also display who is getting highest

salary. Employee salary must be entered by the user at runtime.


A single element in an array is a single variable that contains a single value at a time

A college cafeteria manager conducted a survey to rate the quality of the food. A hundred students were asked using a scale of 1 to 10 with 1 being awful (bad) and 10 being excellent. Write a C++ program that stores the frequency of the students' answers in an integer array. The program should summarize the frequency for each rating in a report form. There are two display options the manager can display the report form or bar chart form.


Write a C++ program to calculate the total marks of each student of a class. This class takes the following subjects Physics, Chemistry and Mathematics. Your program shall be able to calculate the total marks for each student,

Create a class named Marks with data members “student_number”, “name” and “mark”. Create three other classes inheriting the Marks class, namely Physics, Chemistry and Mathematics, which are used to define marks in individual subject of each student. The student number of each student will be generated automatically starting with a prefix STDN followed by 5 integer numbers. The values of the 5 numbers shall be created in increasing order from 00000 to 99999. If a user enters a number larger the 99999 for the number of students in this class, a warning shall be given and program exits. The number of students in this class shall be entered by the user. When done, your program shall commit and print to a .txt file the name of the subject, the highest ranked student.
Create a function named DisplayNumberText to Display Number and Text input by user
Write a C++ program that calculates GCD of given number using function with returning by reference

Can you do this one?Write a statement that assigns finalValue with the division of userNum1 by userNum2. Ex: If userNum1 is 6 and userNum2 is 2, finalValue is 3. I Dion't know what I'm doing wrong!


LATEST TUTORIALS
APPROVED BY CLIENTS