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

WAP to create two different files name like roll and name of at least 5 students and print all on screen.


Information like name and roll number and read that file and print the content on screen. Write a program using which you will able to create file student info in which you need to provide necessary.


Create a class named Complex which contains:

  • data field named real of type double
  • data field named imag of type double
  • no-arg constructor that initializes real & imag to 0
  • parametrized constructor with specified values for real & imag
  • overloaded stream extraction operator << that will display a complex number in the form a + bi
  • overloaded stream insertion operator >> that will ask the user for real and imag part of the complex number
  • overloaded binary + operator and a binary – operator
  • overloaded binary * operator and / operator
  • function mag() that will return the magnitude of the complex number.
  • function conjuage() that returns the conjugate of a complex number

Sample:

Enter the first complex number 

Enter real part: 3

Enter imag part: 4

Enter the second complex number

Enter real part: 4

Enter imag part: -6

You entered the numbers

C1 = 3 + 4i

C2 = 4 – 6i

1: Addition

2: Subtraction

3: Multiplication

4: Division

5: Magnitude

6: conjugate

9: Quit

Enter your selection: 1

C1 + C2 = 7 - 2i


Write a c++ program to plot a graph of function f(x) = x

n + xn-1

. Your program should take a maximum

absolute value of x as well as a positive integer n as input. You will plot a graph for the range [0, x]. You

should label the y-axis according to the maximum value of x.

Sample Output: For x = 3 and n = 2, you should have the following output

12 *

10

08

06 *

04

02 *

00 *

0 1 2 3


Write a program that calculates the occupancy rate for a hotel. The program should start by asking the

user how many floors the hotel has. A for loop should then iterate once for each floor. In each iteration,

the loop should ask the user for the number of rooms on the floor and how many of them are occupied.

After all the iterations, the program should display how many rooms the hotel has, how many of them

are occupied, how many are unoccupied, and the percentage of rooms that are occupied. The

percentage may be calculated by dividing the number of rooms occupied by the number of rooms.

Input Validation: Do not accept a value less than 1 for the number of floors. Do not accept a number

less than 10 for the number of rooms on a floor.



Take n as input from the user. Calculate the sum of the following series up to n-th term using a recursive function.2*3*4 + 4*5*3 + 8*7*2 + 16*9*1 + ⋯

Sample input

3

Sample output:

24+60+112=196

Sample input:

6

Sample output :

24+60+112+144+0+(-832)=-492


Take two positive integers a and b as input from user. Write a recursive program to print all the even numbers in range [a, b].

Sample input:

1 8

Sample output:

1 8 2 4 6 8

Sample input :

2 11

Sample output::

2 4 6 8 10


1. Write a PL/SQL code to print all tables up to a number fetched from a table using implicit cursors.


Start with the publication, book and tape classes. Add base class sales that holds an


array of three floats so that it can record the dollar sales of a particular publication for


the last three months. Include a getdata() function to get three sale amount from the


user and a putdata() function to display the sales figure.


Alter the book and tape classes, so they are derived from both publication and sales.


An object of book or tape should should input and output ans sales data along with


other data.


Write a main function to create a book and tape object and exercise their input/output


capabilities.

Write a class LocalPhone that contains an attribute phone to store a local telephone


number. The class contains member functions to input and display phone number.


Write a child class NatPhone for national phone numbers that inherits LocPhone


class. It additionally contains an attribute to store city code. It also contains member


functions to input and show the city code. Write another class IntPhone for


international phone numbers that inherit NatPhone class. It additionally contains an


attribute to store country code. It also contains member functions to input and show


the country code. Test these classes from main() by creating objects of derived


classes and testing functions in a way that clear concept of multi-level Inheritance

LATEST TUTORIALS
APPROVED BY CLIENTS