Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q1. An employee wants to calculate his total salary after deducting an amount for car loan based on his employee code. Write a java program

image text in transcribed
image text in transcribed
Q1. An employee wants to calculate his total salary after deducting an amount for car loan based on his employee code. Write a java program to find total salary of the employee using following instructions. Save the project/file as QlyourID (ex: Q1425123). (USE switch/if...else statement) (5 Marks) INPUT income of employee. ENTER/INPUT empCode, empName. Find the loan based on the table given below using switch/if...else statements: empCode loan 10 for Director 80% of income 20 for Manager 30% of income 30 for Supervisor 15% of income Others 5% of income Calculate totalSalary where totalSalary = income - loan Display empName and totalSalary Q2. An institution conducted an aptitude test for the students in different subjects. It needs a system to calculate total mark of the student in each course. Write a java program to find total mark of the student using the concept of polymorphism (method overriding) in OOP based on the following instructions. Save the project/file as Q2YourID (ex: Q242$1234). (5 Marks) English Ahme d A) Class name: English_YourFirstName Member variables: essay, objective Member Method: - Constructor to initialize member variables - to calculate and return total mark totalMark = essay + objective B) Class name: Math extends English _Your FirstName Member variables: mcq Test Member Methods: - Constructor to invoke the constructor of the super class and initialize mcq Test - to calculate and return total mark totalMark = mcq Test * 4 C) Controlling class : Q2YourID - To create object of Math and English_YourFirstName - To print total mark in English - To print total mark in Math

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions