title-img


Exceptional Server C++

In this challenge, you are required to handle error messages while working with small computational server that performs complex calculations. It has a function that takes 2 large numbers as its input and returns a numeric result. Unfortunately, there are various exceptions that may occur during execution. Complete the code in your editor so that it prints appropriate error messages, should anything go wrong. The expected behavior is defined as follows: If the compute function runs fi

View Solution →

Virtual Functions C++

This problem is to get you familiar with virtual functions. Create three classes Person, Professor and Student. The class Person should have data members name and age. The classes Professor and Student should inherit from the class Person. The class Professor should have two integer members: publications and cur_id. There will be two member functions: getdata and putdata. The function getdata should get the input from the user: the name, age and publications of the professor. The function put

View Solution →

Abstract Classes - Polymorphism C++

Abstract base classes in C++ can only be used as base classes. Thus, they are allowed to have virtual member functions without definitions. A cache is a component that stores data so future requests for that data can be served faster. The data stored in a cache might be the results of an earlier computation, or the duplicates of data stored elsewhere. A cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when it cannot. Cache hits are served by reading

View Solution →

Vector-Sort C++

You are given integers N .Sort N the integers and print the sorted order. Store the N integers in a vector.Vectors are sequence containers representing arrays that can change in size. Declaration: vector<int>v; (creates an empty vector of integers) Size: int size=v.size(); Pushing an integer into a vector: v.push_back(x);(where x is an integer.The size increases by 1 after this.) Popping the last element from the vector: v.pop_back(); (Aft

View Solution →

Vector-Erase C++

You are provided with a vector of N integers. Then, you are given 2 queries. For the first query, you are provided with 1 integer, which denotes a position in the vector. The value at this position in the vector needs to be erased. The next query consists of 2 integers denoting a range of the positions in the vector. The elements which fall under that range should be removed. The second query is performed on the updated vector which we get after performing the first query. The following are so

View Solution →