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

Write a program to print the area and perimeter of a triangle having sides of 3, 4 and 5 units by creating a class named 'Triangle' with a function to print the area and perimeter.


Assign and print the roll number, phone number and address of two students having names "Sam" and "John" respectively by creating two objects of the class 'Student'.


1. Write a Program in C++ to copy the contents of the file from one location to another location (Ex: C: \Demo \Test.txt to D: \Demo \Test.txt) and also check the content in both files are same or not. 


2. Write a program in C++ to enter a string into file and read the same file to display all the words in the file with stating letter ‘p’.


1. Write a program in C++ to create abstract class Figure having abstract method area(), and data members length, breadth. Derive classes Triangle and Rectangle from Figure having member function area(). Find area of triangle and rectangle by function overriding concept? [Note: sub classes does not contain any data members]. 


2. Write a program in C++ to justify the control flow and use of templates by mentioning overloaded function as well.


Q1. Overload the function find_perimeter() with one, two and three float parameters. The function with one parameter is used to return the perimeter of the circle. The function with two parameters is used to return the perimeter of the rectangle. The function with three parameter s is used to return the perimeter of the triangle. Write the necessary C++ program to test the functionality of above functions.


Q2. Create a class Data with data members: height and breadth of object given by the user and member functions get_data() to read the values and put_data() to display the values. Create another class Rectangle that inherits class Data and implement its methods areaRectangle() and perimeterRectangle() that computes the area and perimeter of a rectangle. Create another class Triangle that inherits class Data and implement its methods areaTriangle() and perimeterTriangle() that computes the area and perimeter of a triangle.


with a custom method called displayVehicle() that displays the details of a vehicle as follows:


If the vehicle is available then it should display the details of a vehicle as the values of the instance variables vehicleID and dailyRate only


Otherwise, if the vehicle is currently on loan it should display the name and license number of the person holding the car as well as the number of days it was rented out. (this obvious includes details above.)




Write a main function that will create 5 Vehicle objects using the data below. Assume all the Vehicles are available initially.


Vehicle ID Daily-Rates ($)


FJH 123N 12.0


DKY 222N 25.0


GAF 333N 18.0


BGH 444N 40.0


FRS 555N 30.0



Provide two methods, one of renting a vehicle and the other for returning a vehicle with the following method specifications.


The rent() methods accepts as argument the name and license number of the person renting the vehicle and also the number of days the vehicle will be on hire. If the vehicle is currently available it should set the status to '0', store the name, license number and days rented in the corresponding instance variables before returning true. Otherwise this method should simply return false. This method should have the following signature: public bool rent (string name, string license, int rented)


The returnBack() method should return 0(zero) if an attempt is made to return back a car which is not on loan, otherwise it should compute and return the charges for renting the vehicle (number of days multiplied by daily-rate). This method should have the following signature: public double returnBack ()

LOOPING STATEMENTS AND FUNCTIONS


Create a flowchart to guide you in the process

Create a function that will accept the value of i and return the value of 

Possible values of i is any positive value from 2 to 10

is computed based on the value of i; see the following table for the sample Input / Output

!!Please see these 3 examples on how the screen will work when the program runs!!

1.)

i : 3

Process: 1*2*3

n: 6


2.)

i: 5

Process: 1*2*3*4*5

n: 120


3.)

i: 7

Process: 1*2*3*4*5*6*7

n: 5040


Screen/Layout

(Home Screen)

Input i:3

Process: 1*2*3

Output: 6


Try Another [Y/N]: Y



Input i: 5

Process: 1*2*3*4*5

Output: 120


Try Another [Y/N]: Y


I'm really fond of even numbers, you know? That's why I'll be letting you make another even number problem yet again. This time, you need to print from a range of two inputted numbers, n1 and n2 (inclusive), all the even numbers from n2 down to n1, in descending order.

How about that?





Read in the contents of a file of real numbers for which the file length is not known ahead of time and could be large. Write the numbers to a new file in reverse order.




Note: Store the data in a vector before writing the numbers to the output file in reverse order.

LATEST TUTORIALS
APPROVED BY CLIENTS