create a class named as car with data members as car
company, cost of carnumber of airbags. Create a file and write the array of objects into file. Search the data by car company from the stored file and display the result
Write a program to create a structure employee having name, id, salary. Create a file “employee.txt” and open in append mode. Write the detail of 5 employee into a file and read the data from the file and display name of employee having highest salary on screen
Create a class to store details of student like roll no, name, and course joined and fee paid so far. Assume courses are C# and ASP.NET with course fees being 2000 and 3000.
Write a program in C++ to open and read the contents of the Text1.txt using the file stream class.
Close the file and again open to update the contents of given file Text1.txt.
Text1.txt : I am enjoying learning OOPS concepts
After update
Text1.txt: I am enjoying learning OOPS concepts
Now learnt C++; Java is my next target.
Create a class called Matrix having the following data members int rows; int cols; int mat[][]. Write a program to implement the following operations (the ones mentioned in comments) on Matrix. The main() function of the above program is as below: int main() { Matrix m1(3,3); // it will initialize rows and cols m1.getdata(); //accept the data in matrix Matrix m2=m1; //copy one matrix contents into another m2.putdata(); // display the contents of matrix Matrix m3; m3.putdata(); }
write a c++ statement as following :
a. Declare int variable num1 and num2.
b. Prompt the user to input two numbers
c. Input the first number in num1 and the second number in num2.
d. Output num1, num2, and 2 times num1 minus num2. Your output must identify each
number and the expression
e. Declare a double named salary
f. Assign 15 to x and y
g. Input the user’s age
h. Initialize total to 0
i. Declare a variable named address to store 15 characters.
j. Declare a constant as float and assign it to 0.125
Statement in C++
k. Declare three variables as integer. Initial the first variable to 10.
l. Declare 5 variables, whereby the first three variables are float and the last two
variables are integer
Write a program using standard string functions that accepts a price of an item and display its coded value. The base of the key is: X C O M P U T E R S 1 2 3 4 5 6 7 8 9 Sample input/output dialogue: Enter price: 489.50 Coded value: PRS.UX
Write a program in c++ to open & read the contents of the text1.txt using the file stream class, close the file and again open to update the contents of the given file text 1.txt
Text1.txt: I m enjoying learing oops concepts
After update
Text 1.txt: I m enjoying learing oops concepts now learnt c++; java is my next target
The system is a duck simulation game. There are ducks, each having weight and number of wings. All ducks can fly and quack, but different type of ducks fly and quack differently. For instance, let us consider the following–
1. Rubber ducks don’t fly and squeak.
2. Mallard ducks fly fast and quack loud.
3. Redhead ducks fly slow and quack mild.
All ducks have following common property:
Type of Duck – Use enum to represent this value
Design classes and interfaces for the above story to meet the following requirements -
a. Create a duck
b. Show details of a duck, i.e. when you call for e.g. ShowDetails() method of a duck, duck should print its traits.
User following concepts: class, interfaces, polymorphism etc.
Write a program using constructor overloading to implement the following tasks:
1.Print sides of a cube
2.Print radius and height of the cylinder
3.Calculate the volume of a cube
4.Calculate thevolume of a cylinder