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 to take input for n number of employee records and write records of all employees in a file named: “record1”. Also write records of all those employees in another file named: “record2” who are taking salary more than 50,000. After writing records in both files, merge their contents in another file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of employee: emp_id, emp_name, emp_experience, emp_salary]


Write a C++program to accept two integers and check if it is greater than or equal to 100. If not, return a message "The number is less than 100". Specify the input of first and second of the possible output.



Create a Class Shape having a field shapeType and a function printMyType.Create another class, Square and Rectangle, which inherits the Shape class and has additional fields length and breadth. Both Square and Rectangle classes will have two functions calculateArea, which will return the object's area, and printMyType, which will print the type of the object.Inside the main, first create the object of class Square and have a length equal to 5 and call the printMyType then calculateArea method after creating the object of class Rectangle having the length equal to 5 and breadth equal to 4 and again call the printMyType and calculateArea method.

Considering the Abstraction Principle, perform the following:

a.       [2 Marks] Define an abstract class by the name of Shape, the class consists of an attribute (D) which refers to the dimension and a member function Area().

b.       [2 Marks] Make the function Area a pure virtual function 

c.     [2 Marks] Define a class Circle which is s subclass of the superclass Shape and define the Area inside the class.

d.       [1 Marks] Define a second class Square which is a subclass of Shape and define the area inside it.


Given a linked list containing n nodes. The problem is to insert a new node


with data x at the middle of the list. If n is even, then insert the new node


after the (n/2)th node, else insert the new node after the (n+1)/2th node

Suppose we have a pointer to float data type which contains the memory address

value 100.

If we add the integer value 3 to this pointer, what will be the value of the pointer if float data

types are 4 bytes in length?


Write a C++ program that takes up to 10-digit integer input from user (can be 1 digit, 2 digit, and so on..); passes this to a function which reverses the digits. Finally, the reversed number should be displayed in the main function. For example: when user enters 10-digit like 1234567890 your function will reverse it to 987654321. Do not use strings. Be careful for big integer values. [use functions, decision control]


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 a recursive function that checks whether

the number entered by the user is a happy number or not for 10 cycles/iterations only. The

output shown in blue colour should be shown by the function and text in yellow colour

should be displayed by the main function.


a. Write a function convert() that converts a decimal number to a binary, octal, and

hexadecimal equivalents. The function will take two arguments: first argument will be

the number to be converted and second argument will be the base in which this number

is to be converted. Function should return the converted value. You may use strings to

represent converted numbers like “0x3A”, “00101100”, “72” etc. Lower limit must be smaller than upper limit.

b. Call convert() function in the main program to produce the following output.

Example output:

Enter upper limit = 20

Enter lower limit = 10

Decimal Binary Octal Hexadecimal

10 00001010 12 0xA

11 00001011 13 0xB

12 00001100 14 oxC

13 00001101 15 0xD

14 00001110 16 0xE

15 00001111 17 0xF

16 00010000 20 0x10

17 00010001 21 0x11

18 00010010 22 0x12

19 00010011 23 0x13

20 00010100 24 0x14


Write a program to take input for n number of employee records and write records of all employees in a file named: “record1”. Also write records of all those employees in another file named: “record2” who are taking salary more than 50,000. After writing records in both files, merge their contents in another file: “finalrecord” and read all records of “finalrecord” file and display on screen. [Attributes of employee: emp_id, emp_name, emp_experience, emp_salary]


LATEST TUTORIALS
APPROVED BY CLIENTS