Implement a C++ program to define function named as ext, to extract the digits that located at even and odd position of five digit number and show the result.
Runtime Input :
00156
Output :
016
05
Write a C++ program to demonstrate multilevel inheritance. The program should print the value of a, b, c declared in differentclasses, value a, is declared as private in the base class, value b is declared as private in class B, with multilevel,class B becomes base class for class C and derived class for A and finally value c declared as private in Class C whereClass C is a derived class and B is a base class. Create an object of the final class C to print all the values
Write a C++ program to read and print employee information as shown below using hierarchical inheritance.your base class (basicinfo) must show basic information of name employee, ID and gender. Create another base classdeptInfo which captures department information like department name, assigned work and time to complete the workin hours, create the last base class which handles loan information like loan details and loan amount.
Enter Name: Mickey
Enter Emp. Id: 1121
Enter Gender: F
Enter Department Name: Testing
Enter assigned work: To test login form
Enter time in hours to complete work: 20
Employee's Information is:
Basic Information...:
Name: Mickey
Employee ID: 1121
Gender: F
Create a C++ program to demonstrate hierarchical inheritance to get square and cube of a number. Base class must calculate square of a number whilst base class 2 calculates cube of a number. The program must prompts the user as follows
Enter an integer number: 10
Square of 10 is: 100
Enter an integer number: 20
Cube of 10 is: 8000
Input a string from user in the following format: Name_RollNo_GPA.
Now perform string tokenization operation on this string to separate the Roll no and GPA. Store each token in a separate row of 2d char array and then print that string. Plus store name in a string, roll no in integer and GPA in float. And also print them. You are not allowed to use atoi() and atof().
Note: You cannot call built in function of strtok()
One day someone tells Pierre that there is a sweet shop across the street named
"Olivier and Bhalla's Store for Something Sweet". This was very frustrating. Pierre
contacted the authorities about the knockoff right away. The government ruled that if
the name of a knockoff brand has more than 3 different letters than the original
companies name, they are considered a novelty and are allowed to continue operating.
If the name of the knockoff company is within 3 (inclusive) letters of the original
companies name, then they are labelled as a knock off and should be closed down.
Create a function that takes two different company names, and returns wether or not
the imposter company is a Novelty, or a Knockoff.
my function dosent work pls help me with an example wat the final function looks like:
You have a data file that contains a bunch of numbers (.data file)
zoom_data.dat
3 4
15 16
-5 6
11 -12
The program should get this file and change the string into an int. After, the program should calculate the distance of two integers.
For example, output should be
1<NEW LINE>
1<NEW LINE>
11<NEW LINE>
23<NEW LINE>
# file_name_holder: the string that represents the file name
# dat_buff : the buffer that you use to hold data (MAXIMUM: 300 bytes)
check_file:
####################
####################
jr $ra
You must demonstrate Polymorphism for this problem. You want to develop an HR system for any company to carry information about employees who work there. Every employee has an id and name. Permanent employees are paid a fixed salary per month while those on contract are paid on hourly basis (information that needs to be kept is hours worked and hourly rate and the salary is the product of the two). i. Identify the classes needed and the relationship between them ii. Give the interface of these classes in (.h) files and implement the member functions in a separate .cpp file iii. Give a menu based program that allows a user to add new employees and print their data. It could be as follows:
http://prnt.sc/12u5jxt
We want to implement a flex like system to carry information about students and the courses they are currently enrolled in. The input data will be present in two text files called student.txt and courses.txt. The structure of the student.txt file will be (rollnumber, name, date of birth , batch, department) The structure of the courses.txt file will be (rollnumber, course code, coursename, credit hours) As shown above both the files will be sorted by the rollnumber and a student could be enrolled in any number of courses. Your system should be able to cater for any number of students. You have to i. Decide the classes needed to carry the above info (you might need a dynamic array of courses within the student) ii. Read the information present in the files iii. Display the students data properly on console.
Write a Java code that creates a variable of int type named 'mode' and sets its initial value to 12. Create a method named 'setTime()' of void type that take four parameters: (1) one int parameter named 'h', (2) one int parameter named “m”, (3) one int parameter named “s”, and (4) one char parameter named 'ap'. In the body of the “setTime()” method, use an if statement to check whether or not the value of “h” is greater than or equal to 12. If so, subtract 12 from 'h'. Then, assign 12 as value to the 'mode' variable. Display the value of hour, minute, second, and AM/PM being set as well as the mode. Create another form of 'setTime()' method of void type that take only three parameters: (1) one int parameter named 'h', (2) one int parameter named 'm', and (3) one int parameter named 's'. In the body of the 2nd form of 'setTime()' method, assign 24 as value to the 'mode' variable. Display the value of hour, minute, and second being set as well as the mode.