Write code that puts "less than -9\n" to output if the value of userNum is less than -9.
Ex: If userNum is -15, then output is:
less than -9
userNum: -15A college offers diploma course with five set modules each. Define a class Student as an ADT that uses separate files for the interface and the implementation. This class represents a record of one student’s registration and results. For each Student the following information should be kept as member variables:
the student’s name, ID, student number, the name of the diploma, average mark, an array with the five module codes for the diploma, and another array with five results - one for each of the modules.
Class Student should also have a member function calcAverage() to calculate the average for the five results and a member function pass() to determine whether or not a student has passed the module. A student only passes a diploma course if he or she has obtained more than 50% for all the modules, regardless of his or her average mark. Member function pass()should return a boolean value.
.
Create a class called bMoney. It should store money amounts as long doubles. Use the function ms_to_ld() to convert a money string entered as input into a long double, and the function ld_to_ms() to convert the long double to a money string for display. You can call the input and output member functions getmoney() and putmoney().
Overload the operators +,-,*,/ appropriately.
create a class Matrix the stores it in a safe 2D array .that is it it should check for array index bounds .a constructor should allow the programmer to specify the actual dimensions of the matrix. define number functions : putel() for taking 3 argument row index , column index and the element storing it in the corresponding location. getel() for taking 2 arguments row and column indexes and returns the elements from that location . overload the operators +,-,and * appropriately
Provide a member function of class linkedListType that determines the maximum element in a list. Use the following header template Type linkedListType:: max(); You may assume that operator> is overloaded for Type.
struct Module {string moduleName; string moduleCode; string lecturer; int nrStudents} Turn the Module struct into a class. The class should have member variables for all the values in the corresponding struct. Make all the member variables private. Include public member functions for each of the following: a default constructor that sets the string member variables to blank strings, and the int member variable to 0; an overloaded constructor that sets the member variables to specified values; member functions to set each of the member variables to a value given as an argument to the function; member functions to retrieve the data from each of the member variables; Test the class in a program that instantiates an object of class Module. The program should then input values for the object, and use the mutators to assign values to the member variables. Use the accessors to obtain the values of the object's member variables and display those values on the screen.
struct student
{
char IDNumber[10];
char Name[20];
int Age;
char Department[25];
float CGPA;
} ;
Choose your structure name. Include five member variables for your structure. Then do the following questions based on your structure declaration.
a) Define a function that declares array of student and registers 10 students.
b) Define a function that displays full information about those 10 students.
c) Define a function that can be used to update information about the first student.
1.Write C++ program to accept N number from the user and print the elements of the array in reverse order using a pointer.
2.Write C++ program that accepts N elements from the user and display the sum of array elements using pointers.