Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Write a program that computes and displays the charges for a patient’s hospital stay. First, the program should ask if the patient was admitted as an in-patient or an out-patient. If the patient was an in-patient the following data should be entered: i. The number of days spent in the hospital ii. The daily rate iii. Charges for hospital services (lab tests, etc.) iv. Hospital medication charges. If the patient was an out-patient the following data should be entered: i. Charges for hospital services (lab tests, etc.) ii. Hospital medication charges. The program should use two functions to calculate the total charges. One of the functions should accept arguments for the in-patient data, while the other function accepts arguments for out-patient data. Both functions should return the total charges. Input Validation: Do not accept negative numbers for any information. 


1) Create a public class named: Employee that would get the firstname and lastname of each

employee from the keyboard/user

2) Create three objects: prog, adm and lib, for programmer, admin and librarian respectively to

access the properties in Employee class.

3) Create EmployeeSalary as parent interface to store basic_sal, housing_all and

transport_all. The values for these three items are fixed for all Employee and has abstract

function calculateSalary.

4) Create three sub classes namely: programmer, admin and librarian to store bonus,

overtime and total salary for each employee

5) Each of the constructor in (4) should inherit the properties of Employee(using the super

keyword) and implement the EmployeeSalary interface.

6) Hide the properties from the parent class Employee using encapsulation principle.

7) Use getters and setters to make the properties in Employee visible and accessible to other


Write a program that will predict the size of a population of red ants. The



program should ask the user for the starting number of red ants e.g. 2,000,000,



their average daily population increase as a percentage of current population



e.g., 5%, and the number of days they will multiply e.g. 10 days. Use a do while



to display the size of the population for each day.



Draw a flow chart and write down a pseudo code before attempting this



number.



Input Validation:



Do not accept a number less than two for the starting size of the population.



Do not accept a negative number for average daily population increase.



Do not accept a number less than one for the number of days they will



multiply.


Discuss security measures to put into place in order to mitigate various cloud security threats. 


Write a program that declares and initializes an array of 7 integers. The program uses these static methods to perform different operations on the array:

void printArray(int[] arr) – takes the array as parameter and prints the array in horizontal order

int sumOfArray(int[] arr) – takes the array as parameter and returns the sum of the array

int getHighest(int[] arr) – takes the array as parameter and returns the highest value in the array

int resetArray(int[] arr) – takes the array as parameter and resets the value of each element to 0


Sample output:

Here’s the array: 

3 1 3 2 1 9 1

Sum: 20

Highest: 9

Here’s the array: 

0 0 0 0 0 0 0




Create a static method

public static int pow(int base, int exp)

that returns the power value of base raised to its exponent. Use this method in a program that first asks for a base value and an exponent value, calls pow() and then prints the result.


Sample output:

Enter the base: 2

Enter the exponent: 3

The power value is 8




Write a program that uses a static method called printMessage that takes a string and an integer as parameters. The string and integer parameters represent a person’s name and age. When printMessage is called with arguments “Joan” and 18, the method prints “Joan, you are 18 years old”.


Sample output:

Enter your name: Joan

Enter your age: 18

Joan, you are 18 years old




Random Activity

The goal of this coding exam is to quickly get you off the ground with the DOM Manipulations.


Refer to the below image.



Achieve the given functionality using JS.


Make a HTTP request(GET method) using fetch with the URL https://apis.ccbp.in/random-activity to get a random activity.


Add loading status with Bootstrap component spinner while making an HTTP request.


Create a program that will calculate a student's total payment fee after a scholarship has been applied. Scholarship.java will contain two methods: setGrade() and getScholarship(). The setGrade() will process the scholarship application, and will set new amount to be paid, while getScholarship() will only return the new amount after being called.

GPAs ranging from 1.76 to 5.00 will not be eligible for a scholarship and must pay the full tuition. GPAs ranging from 1.46 to 1.75 will receive a partial scholarship. GPAs ranging from 1.00 to 1.45 will receive a full scholarship. Out-of-range GPAs are invalid.

In the main class (SurnameScholarship.java), the user will be asked to enter his/her GPA, tuition fee, and miscellaneous fee.


Create a java program which allows the user to enter two values (Using JOptionPane) to be divided. The program catches an exception if either of the entered values is not an integer.

 

Declare three integers—two to be input by the user and a third to hold the result after dividing the first two. The numerator and denominator variables must be assigned starting values because their values will be entered within a try block. Also declare an input String to hold the return value of the JOptionPane showInputDialog() method.int numerator = 0, denominator = 0, result; String display;

 

 

 

Add a try block that prompts the user for two values, converts each entered String to an integer, and divides the values, producing result(Cast the result to a double).

 

Add a catch block that catches an Arithmetic Exception object if division by 0 is attempted. If this block executes, display an error message, and force result to 0.


LATEST TUTORIALS
APPROVED BY CLIENTS