Describe and illustrate the characteristics of an object? What is the syntax for a multi dimensional array and a two dimensional array ?
• Create class passenger, bus and seat. Each Seat object has three attributes, i.e., seat number, availability flag (1 if the seat is available, 0 otherwise), and an occupant (empty string is the seat is still available, otherwise a Passenger object).
• Each Passenger has a name and can purchase a Seat in a Bus. purchase_seat function needs a seat number (not a Seat object) and the Bus object. If that particular seat is available (as indicated by its availability flag), it will be assigned to that passenger.
• Each object of Bus class is composed of 24 Seat objects. Bus object also has a ticket price per seat attribute and a total booking amount attribute. Use a loop in the constructor to create 24 Seat objects. As seats are purchased by passenger, their ticket price is added to total booking amount attribute. Bus has a display function in which each Seat object of the Bus calls display function of Seat class.
• Create a Bus object, and two passenger objects. Both passengers try to buy seat 15
Write and run a C++ program to test the following is_square() function that determines whether the given integer is a square number
What values are returned during the following sequence of queue operations, if
executed on an initially empty queue? enqueue(5), enqueue(3), dequeue(), enqueue(2),
enqueue(8), dequeue(), dequeue(), enqueue(9), enqueue(1), dequeue(), enqueue(7),
enqueue(6), dequeue(), dequeue(), enqueue(4), dequeue(), dequeue().
Write a program that will ask user to enter a digit character (i.e. ‘0’ or ‘1’ .... or ‘9’). If user
enters a non-digit character then the program should display message to re-enter correct input. If user
enters a correct character (i.e. a digit character) then your program should convert that character to
a same digit but in integer type. Do this for five inputs. Finally, add all digits and display their sum. Do
not use any library function or loops.
Give the algorithm to convert the input dollars(s) into the equivalent peso. One dollar is approximately equal to 50.60 pesos. Then display the result.
Write a program that takes five integer numbers (range 0 to 10). And display horizontal
bar chart. Do not use loops. You can use <iomanip> header file for printing bar chat.
write this python code using data Classes
4. Create a class SalariedEmployee
a. SalariedEmployee class is a child class of Employee class. It should inherit all the attributes of
Employee class and add its own attribute baseSalary.
b. Create a method called CalculateNetSalary which should deduct 13% Provisional Tax, 1%
insurance and 3% Fed Tax from baseSalary and display the NetSalary.
c. Create a method called displayData which should display the FirstName, LastName, Age,
Address, ContactNumber, EmployeeID, OrganizationName, Position, baseSalary and
NetSalary.
5. Create a class BasePlusCommissionEmployee
a. BasePlusCommissionEmployee class is a child class of CommissionEmployee. It should inherit
all the attributes of CommissionEmployee class and add its own attribute baseSalary.
b. Create a method called calculateTotalEarning which should inherit super class method
calculateCommission and add baseSalary in it.
What values are returned during the following series of stack operations, if
executed upon an initially empty stack? push(5), push(3), pop(), push(2), push(8), pop(),
pop(), push(9), push(1), pop(), push(7), push(6), pop(), pop(), push(4), pop(), pop().
COMPUTE GRADE PROGRAM
Create a function named StudeInfo that will accept the following values from the user:
StudentID, StudentName, Course, Age, PrelimGrade, MidtermGrade, FinalTermGrade.
Create a function named ComputeGrade that will compute Final Average which is computed as the sum of PrelimGrade, MidtermGrade and FinalTermGrade divided by 3.
Display the output with the following format: (sample output)
*************************************************************************************
Student ID : 00-00-01
Student Name : FERNAN W. AMMAQUI