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

Bus Seat Reservation

Please do exactly like this:

1. The program should ask the user to enter what row and seat number to reserve. Indicate

an ‘X’ mark if the seat is reserved.

2. Repeat Step 1; the program will stop until the user enters a negative number.

Please do exactly like this:

Screen/layout

Bus Seat Reservation:

Col 1 Col 2 Col 3 Col 4

row 1 | * * * *

row 2 | * * * *

row 3 | * * * *

row 4 | * * * *

row 5 | * * * *

row 6 | * * * *

row 7 | * * * *

up to row 10

Enter row and column no. to reserve separated by space (enter negative no. to exit): 4 4

Second Seat reservation sample output

Col 1 Col 2 Col 3 Col 4

row 1 | * * * *

row 2 | * * * *

row 3 | * * * *

row 4 | * * X X

up to row 10



numbers: the positive, the zero, and the negative ones. Today, we shall pay attention only to the negative ones now. Make a loop that will accept random decimal/float numbers. When the user inputs 0, the loop will terminate and then output the sum of all negative numbers inputted in 3 decimal places.

write the programme that implementes the following algorithms? start: read the total hours the employee has woked,Total hours. Read the hourly rate of pay for the employee,Hourly rate. gross salary=total hours*hourly rate. tax=gross salary *0.1 Net salary =gross salary-tax. Display net salary

Write a python program to generate a quiz using two files, named Questions.txt and Answers.txt. The program opens Questions.txt and displays the question with options on the screen. The program will verify the Answer.txt file and display the scores.

For example, Questions.txt file contains the following details: 

1. Who is the prime minister of India? 

A. Narendra Modi   B. Shivraj Patil 

2. Who is the President of USA? 

A. Donald Trump     B. Joe Biden    

Answer.txt file contains the following details: 

1.A 

2.B 

If inputs are A and B, then the Score is 100  

case=1 

input= A 

output=100 

case=2 

input: A 

output=50 

case=3 

input=B 

output=0 




Q1. Define a class Deposit that has a principal, a rate of interest, which is fixed for all 

deposits and a period in terms of years. Write member functions to

(i) alter(float) which can change the rate of interest.

(ii) interest() which computes the interest and returns it.

(iii) print() which prints data as shown below. Note that the width of each column is 20.


Q3. Define a class License that has a driving license number, name and address. Define 

constructors that take on parameter that is just the number and another where all 

parameters are present.


Q2. Assume that the cell users are two kinds – those with a postpaid option and those 

with a prepaid option. Postpaid gives a fixed free talk time and the rest is computed at 

the rate of N2.90 per pulse. Prepaid cards have a fixed talk time.

Define a class Cell_user as a base class and derive the hierarchy of classes. Define 

member functions and override them wherever necessary to

(i) retrieve the talk time left for each user.

(ii) print the bill in a proper format containing all the information for the postpaid user


Task #12: Using Arrays and Methods


In this task, you are being asked to write methods that manipulate arrays in Java.


Write a method that swaps the value of the array in such a way that all negative values comes


before the positive values in the array. The method should then returns the array.


You may use the following header for this method:


static int[] negativeBeforePositive(int[] array)


NOTE: Declare and initialize the array without taking the input from user.


Treat the 0 as a value greater then negative numbers, but lesser than positive numbers.


You may declare some temporary arrays for your help.


1. Create a program called ArrayNegativeBeforePositiveLab1.java.


2. Create appropriate variables and assign values using a Scanner object.


3. Correctly display appropriate messages.

Page 11


Task #11: Using Arrays and Methods


In this task, you are being asked to write methods that manipulate arrays in Java.


Write a method that returns the smallest value from a given integer array.


You may use the following header for this method:


static int smallest(int[] array)


Write another method that returns the largest value from a given integer array.


You may use the following header for this method:


static int largest(int[] array)


Write a third method that returns the middle value from a given integer array if the array length is


odd, or returns the average of the two middle values if the array length is even.


You may use the following header for this method:


static double middle(int[] array)


NOTE: Declare and initialize the array without taking the input from user.


1. Create a program called ArrayValuesLab1.java.


2. Create appropriate variables and assign values using a Scanner object.


3. Correctly display appropriate messages.

Task #10: Using Arrays and Methods


In this task, you are being asked to write methods that manipulate arrays in Java.


Write a method that returns the reverse of a given integer array.


You may use the following header for this method:


static int[] reverseArray(int[] array)


For example, suppose that the array has 10 values: 10 9 8 7 6 5 4 3 2 1


The method will return an array which would contain the values: 1 2 3 4 5 6 7 8 9 10


NOTE: Declare and initialize the array without taking the input from user.


4. Create a program called ArrayReverseLab1.java.


5. Create appropriate variables and assign values using a Scanner object.


6. Correctly display appropriate messages.

LATEST TUTORIALS
APPROVED BY CLIENTS