Questions: 9 913

Answers by our 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 & Filtering

Write a program in C++ that reads some text entered through the keyboard till the end of 

file (eof) character is entered. The words in the text are written to different text files as per 

the following conditions:

• The words beginning with any of the lowercase vowels (a, e, i, o, u) are written to 

a file fileV.txt.

• The words beginning with a digit (0 – 9) are written to a file fileD.txt.

• All other words are written to a file fileRest.txt.


The first function must be responsible for inputting the data, the second for computation of squares and the third, for Displaying the result.


Modify the program from number 1 by adding a class and apply the "outside of a class function". 20 points

Class Distance with private attributes Feet (int) and Inches (float). Also, define public member functions:

 Set_distance( )

 Display_distance( ) – to display the values of class attributes

Include a main ( ) program that creates an instance (object) of type Distance. Ask the user to enter the value of Distance variables and call the appropriate functions to set the object value and then display the object value.

Define the class member functions outside the class using scope resolution operator (::).

Task 7-01

 Define a constructor for the class Distance, that should initialize the Distance attributes (feet, inches) to 0.

 define an overloaded constructor that initializes the object to certain values.

e.g, Distance d1, d2(10,2) initialize d1 to 0 and values of d2 to 10, 2

Task 7-02

 Make changes to the Set_distance( ) function and class constructor so that the values of inches never exceed 11. e.g

obj.Set_distance (10,12) - the value of obj members will be feet: 11, inches: 0


Consider a toll plaza on a bridge. Cars passing through the toll plaza must pay a toll of Rs.30/-. Most of the time, they do, but every now and then, a car drives by without paying. The toll plaza records the number of cars that have passed through as well as the total amount of money collected. Model this toll-plaza with the help of the toll-plaza class. The classs two data items are to hold the total number of cars and to hold the total amount of money collected. For the c++ class, implement:

 A constructor that initializes both data items to 0.

 A member function called payingCar() increments the car total and adds 30 to the cash total.

 Another function, called nopayCar() that increments the car total but adds nothing to the

cash total.

 Finally, a member function called display() should display the total cars and the total cash collected.


Write a C++ class to represent an Employee. Each employee is given a name, an age, a NIC number, an address, and a salary. Furthermore:

 The Employee class should keep track of how many employees (objects) have been created in the system.

 Your Employee class should initialize all of its fields via a constructor.

 Create function prototypes to set and get an employees zip code.

 Declare a print_employee() function that prints all of an employee object's details.

(Whenever possible, use constant functions.)


Create a structure course with some attributes i.e course_ID, course_title, credit_hrs etc.. Then Implement following 5 functions (Known as CRUDS operations which means CREATE, READ, UPDATE, DELETE, SEARCH operations):


1. addAStudent

2. updateAStudent

3. deleteAStudent

4. searchAndDisplayAStudent

5. displayAllstudents


After that, create an array of 5 courses in main function. Create a menu in main function to enable user to select and perform the operations we created above. Program must not exit until and unless user wants to do so.


Write a program to find the product of 2 power numbers if the base and the exponent of these numbers are



provided in the main function, also check that the base of both the power number are the same, as the



product of 2 power numbers can only be calculated if their base is the same. Use pass by reference



mechanism to compute the product of these power numbers then display the result in main function.




Note: Your function should not return a value.

Create an IceCreamCone c++ class with fields for flavor, number of scoops, cone type, and price.

Unless arguments are supplied, flavor defaults to "Vanilla," number of scoops defaults to 1, and

cone type defaults to "Sugar"

The constructor calculates the price based on 75 cents per scoop, with an additional 40 cents for a waffle cone.


Write a program to find the greatest common factor if the two numbers are provided in the main function.



Use pass by value mechanism to compute the greatest common factor and return the result back to the main



function then display the result in the main function.




LATEST TUTORIALS
APPROVED BY CLIENTS