Write the definition for a class called Distance that has data member feet as integer and inches as float. The class has the following member functions:
void set(int, float) to give value to object
void disp() to display distance in feet and inches
Distance add(Distance) to sum two distances & return distance
1. Write the definitions for each of the above member functions.
2. Write main function to create three Distance objects. Set the value in two objects and call add() to calculate sum and assign it in third object. Display all distances.
Draw a structured flowchart or write pseudocode describing the logic of the following scenarios:
Move the robot to start from a sitting position in a corner, cross the room, and end up standing outside the room behind the door.
Allow the robot to start from a sitting position in one chair, stand up, cross the room, close the door and, return to the chair, and sit.
// Please i need this answer with full proper explonation //
(Gas Mileage) Drivers are concerned with the mileage obtained by their automobiles. One driver has kept track of several trips by recording miles driven and gallons used for each trip. Develop a C++ program that uses a while statement to input the miles driven and gallons used for each trip. The program should calculate and display the miles per gallon obtained for each trip and print the combined miles per gallon obtained for all tankfuls up to this point.
// I need this answer this proper explonation + full step by step please if any one know //
Q1: (Salary Calculator) Develop a C++ program that uses a while statement to determine the gross pay for each of several employees. The company pays “straight time” for the first 40 hours worked by each employee and pays “time-and-a-half” for all hours worked in excess of 40 hours. You are givenalist of the employees of the company, the number of hours each employee worked last week and the hourly rate of each employee. Your program should input this information for each employee and should determine and display the employee’s gross pay.
Enter hours worked (-1 to end): 39
Enter hourly rate of the employee ($00.00): 10.00
Salary is $390.00 Enter hours worked (-1 to end): 40
Enter hourly rate of the employee ($00.00): 10.00
Salary is $400.00
<..............................................................................>
Implement the following Operator Overloading question for C++ without using any libraries.
A BinaryStore calculator will store bytes “stored in strings” with their addresses, i.e., at each address in the BinaryStore there is a stored Byte. Each address will be 4 characters string and each byte will be 8 characters strings.
Create a class BinaryStore and class Byte that offer following overloaded operators. class offers the following methods:
an overloaded+=operator that will add the address in the list of BinaryStore
an overloaded+ that will add two string bytes for Byte Class
an overloaded- that will subtract two string bytesByte Class
an overloaded||operator that will give the string which is bit by bit logical or of act two string bytes for Byte Class
an overloaded&&operator that will give the string which is bit by bit logical and of act two string bytesfor Byte Class
an overloaded==operator that will give bool value if they are equal or notfor Byte Class
Note: without using library and functions.
Write a C++ program that converts a decimal number to a binary, octal, and
hexadecimal equivalents. First, the program will ask to fix a range for the lower and
upper limit in which the conversion is required. The lower limit should not be less than
0 and greater than the upper limit. For example, if you enter a negative number or
greater than the upper limit, then the program should print a message for the invalid
input and will ask you again to enter a decimal number within the range. If you
correctly specify the upper and lower limits, then the program will print a table of the
binary, octal and hexadecimal equivalents of the decimal numbers in the range of
lower limit through upper limit.
Specific grading criteria: In this program you should use all the loops (e.g., while,
do-while and for loop) each of them only one time. The output mentioned below is just
an example; more clear and well- presented output will improve your points.
Note: without using the functions. only do in main function and by using loops.
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 C++ code that checks whether the number
entered by the user is a happy number or not for 10 cycles/iterations only.
Example: Assume a number 19
Define a function CoordTransform() that transforms the function's first two input parameters xVal and yVal into two output parameters xValNew and yValNew. The function returns void. The transformation is new = (old + 1) * 2. Ex: If xVal = 3 and yVal = 4, then xValNew is 8 and yValNew is 10.
Using the CelsiusToKelvin function as a guide, create a new function, changing the name to KelvinToCelsius, and modifying the function accordingly.
WAP in c++ containing a possible exception. Use a try block to throw it and a catch block to handle it promptly.