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 design a class complex to represent negative numbers. The negative class


should use an external function (use it as friend function) to add two negative numbers. The


function should return an object of type negative representing the sum of two negative


numbers.

Write a user defined method named getMark that can be used to get a valid mark from the user. 

Your method must continuously ask the user for a mark, until a valid mark is entered (valid marks 

are between 0 and 100). If a user enters an invalid mark, display an error message before asking 

for a valid mark to be entered. The method must return the valid value to the calling program.

Write a user defined method named isPass that can be used to determine whether a mark is a 

pass mark (greater or equal to 50). The method must take as input a mark, and return a boolean, 

indicating whether the mark was a pass mark.

Write a program that reads in 5 marks by using the getMark method to ensure that valid marks are 

processed. You need to calculate the sum and the average of the marks. Your program must also 

use the isPass method to determine the number of pass marks entered. When the 5 marks have 

been processed you need to display the sum, average and number of passes (from these marks).


Create a class Employee having basic its details like name, age, Salary etc. Let there be a function show details which will print all the values for the data members. Further, inherit the same class to create two different classes Developer and Manager.


Implement the concept of runtime polymorphism by invoking the show details function


Write an algorithm and implement a program in C to read the data from a

file (called “test.txt”), transform the data according to the discussion in

“Introductory”, and afterwards, save in another file (called “final.txt”).


Create a function which receives a pointer of array as a parameter and calculates the sum of prime

numbers and sum of non_prime numbers in that array. Then compares them to find out which one is

larger (sum of prime or sum of non_prime). Return both sum of prime and sum of non_prime numbers

also and print those in the main function.


Create a function to compare the elements of 2 arrays. Function should receive two pointers to an array

and then check if the elements are same in both arrays or not. If both arrays are same return true,

otherwise false.


Suppose you want to send a message to your friend but don’t want others to understand that message.

So, you have decided to encrypt the message.

Now, suppose the message is in a string variable called MSG. a) You have to encrypt the message and

change the string so that others cannot understand it. b) Again, decrypt the encrypted message.


a)         Method getData: This method reads and stores the data in the two-dimensional list.

 

b)         Method averageHigh: This method calculates and returns the average high temperature of the year.

 

c)         Method averageLow: This method calculates and returns the average low temperature of the year.

 

d)         Method indexHighTemp: This method returns the index of the highest temperature in the list.

 

e)         Method indexLowTemp: This method returns the index of the lowest temperature in the list.


Store the details of the following 3 flights in a 2-dimensional tuple:

Flight number Destination Departure time

EK004 London 12:30

EK012 Paris 14:00

EK052 Male 16:15

Create a function called checkFlightNumber which accepts a flight number as an input parameter. This function will check if the flight number is found in the tuple which contains the flight details and return TRUE of found or FALSE if it is not.

Your program should keep asking for passengers’ (loop)details until the user enters n to stop. The program should first ask for the passengers’ flight number and use the checkFlightNumber function to check if it is valid or not. If checkFlightNumber returns FALSE, your program will print an appropriate error message and ask the user to try again. However, if checkFlightNumber returns TRUE, your program should ask

the user to enter the following passenger details:

1.Name

2.Date of birth

3. Passport number


You are given on array a of n integers on which the followings operations can be performed





Pick an index i,0<= i<n.




Choose any integer p.




Replace a

LATEST TUTORIALS
APPROVED BY CLIENTS