0% found this document useful (0 votes)
20 views3 pages

JAVA PROGRAMMING_LAB QUESTIONS Modified

The document outlines various programming tasks related to event management, statistics, and mathematical calculations. It includes requirements for calculating total expenses for events, generating frequency distributions, and determining the oldest and youngest passengers in a hijacking scenario. Additional tasks involve creating matrices, counting days between years, and analyzing string data, among others.

Uploaded by

timepass1234tp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
20 views3 pages

JAVA PROGRAMMING_LAB QUESTIONS Modified

The document outlines various programming tasks related to event management, statistics, and mathematical calculations. It includes requirements for calculating total expenses for events, generating frequency distributions, and determining the oldest and youngest passengers in a hijacking scenario. Additional tasks involve creating matrices, counting days between years, and analyzing string data, among others.

Uploaded by

timepass1234tp
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Q1) Total Expenses for the Event

The prime functionality of an Event Management System is budgeting. An Event Management


System should estimate the total expenses incurred by an event and the percentage rate of each of the
expenses involved in planning and executing an event. Nikhil, the founder of "Pine Tree" wanted to
include this functionality in his company’s Amphi Event Management System and requested your
help in writing a program for the same.
The program should get the branding expenses, travel expenses, food expenses and logistics expenses
as input from the user and calculate the total expenses for an event and the percentage rate of each of
these expenses.

Q11) A common problem in statistics is that of generating frequency distribution of the given data.
Assuming that the data consists of n positive integers in the range 1 to 25, write a program that prints
the number of times each integer occurs in the data.

Q2) Event Details


Be it a last-minute get-together, a birthday party or a corporate event, the "Pine Tree" Event
Management Company helps you plan and execute it better and faster. Nikhil, the founder of the
company wanted the Examly Event Management System to get and display the event details from his
Customers for every new order of the Company.
Write a program that will get the input of the event details like name of the event, type of the event,
number of people expected, a string value (Y/N) telling whether the event is going to be a paid entry
and the projected expenses (in lakhs) for the event. The program should then display the input values
as formatted output.

Q12) Youngest and Oldest


The Pan Am 73 flight from Bombay to New York en route Karachi and Frankfurt was hijacked by a
few Palestinian terrorists at the Karachi International Airport.
The senior flight purser Neerja Banhot had to wither her fear and start evacuating the passengers on
board. She pleaded the hijackers to release the oldest and the youngest person in the aircraft. Heeding
to her plea the chief of the hijacker agreed to let go the oldest and the youngest. Given the ages of the
passengers find the oldest and the youngest.

Q3) Find the total customers


Jeevan is running a sports club. He already had N number of customers and due to the offer that he
declared yesterday a lot of new members have joined the club today. Your task here is to write a
program to find the total number of customers that he has.

Q13) Johnsy wants to create a matrix in which the elements are formed differently. The elements are
formed by adding the values of their index positions. Write a program that obtains the order of the
matrices and creates a matrix by adding the values of their index positions.

Q8) Write a program to find sum of all natural numbers between 1 to n

Q18) Problem statement: Write a Java program to count the number of days between two given
years.

Q9) Problem statement


Write a program to print x pattern of the given odd length string. It should contain two methods
namely main and pattern. The main method should pass the inputs to the pattern.
Refer sample output for formatting specifications.

Q19) Finding Next Element


Problem Description
Suppose you are working on a text analysis tool for a language learning app. The app provides a
sentence in the target language, and the user must translate the sentence into their native language. To
help users learn new vocabulary, you decide to include a feature that shows a list of all the unique
words in the sentence. Write a Java program that prompts the user to enter a sentence, tokenizes the
sentence using the 'StringTokenizer' class, and list out the words in the given sentence
Q4) The Acme Tennis Ball Company is designing a new box to ship its products. The marketing
department wants a triangular box that can hold 4 balls, as in the illustration below. The balls fit
exactly inside the box, just touching all three walls and the end caps of the container. All 3 walls of
the box are the same size (equilateral triangle). Assume a tennis ball is 6 cm in diameter, and ignore
the thickness of the box material. What will be the length and breadth of the material used to make the
box? Write a program that finds the measure of a side of the box. Program must also display the
length and breadth of the material used to make the triangular box.
The formula to be applied for the above problem is:
side = sqrt(3)*diameter
length = side*3
breadth = 4*diameter

Q14) Valid Initial Configuration


Nurikabe logical game (sometimes called Islands in the Stream) is a binary determination puzzle. The
puzzle is played on a typically rectangular grid of cells, some of which contain numbers. You must
decide for each cell if it is white or black (by clicking on them) according to the following rules:
· All of the black cells must be connected.
· Each numbered cell must be part of a white island of connected white cells.
· Each island must have the same number of white cells as the number it contains (including the
numbered cell).
· Two islands may not be connected.
· There cannot be any 2x2 blocks of black cells.
Unnumbered cells start out grey and cycle through white and black when clicked. Initially numbered
cells are white in color.
Problem Statement:
Write a program to check whether the given board configuration is a valid initial configuration.
Below figure is the sample valid initial configuration.

Q5) Grades of Rides


“AquaticaCarnival” is the most successful event dedicated to children and families. The Event has
more than 20 rides for children and adults and the organizers always ensure not to compromise on the
safety of the visitors.
To ensure the safety of the rides, the organizers have graded the rides in the fair according to the
following conditions:
Hurl Factor must be greater than 50.
Spin Factor must be greater than 60.
Speed factor must be greater than 100.
The grades are as follows:
Grade is 10 if all three conditions are met.
Grade is 9 if conditions (i) and (ii) are met.
Grade is 8 if conditions (ii) and (iii) are met.
Grade is 7 if conditions (i) and (iii) are met.
Garde is 6 if only one condition is met.
Grade is 5 if none of three conditions are met.
Write a program display the grade of the rides, given the values of hurl factor, spin factor and speed
factor of the ride under consideration.

Q15) Count Uppercase and Lowercase Letters


Obtain a String and write it into a file. Read the file contents and print the number of uppercase and
lower case letters present in the file.
Q6) Triangle Game
The Westland Game Fair is the premier event of its kind for kids interested in some intellectual and
cognitive brain games. Exciting games were organized for kids between age group of 8 and 10. One
such game was called the "Triangle game", where different number boards in the range 1 to 180 are
available. Each kid needs to select three number boards, where the numbers on the boards correspond
to the angles of a triangle.
If the angles selected by a kid forms a triangle, he/she would receive Prize 1. If the angles selected by
a kid forms a right triangle, he/she would receive Prize 2. If the angles selected by the kids form an
equilateral triangle, he/she would receive Prize 3. If the angles selected by a kid do not form even a
triangle, then he/she will not receive any prizes. Write a program for the organizers to fetch the result
based on the number boards selected by the kids.

Q16) The minimum element in an array


Obtain an array and write it into a file. Read the file contents and print the minimum element in the
array.

Q7) Janu wants to write a java program to print the number of occurrences of a particular prime
number from the list of all prime factors of every number between the given limits.
Suppose the given limits are 2 and 8.
The numbers between this limit is
2345678
The list of all prime factors of the above numbers are
2
3
2,2
5
2,3
7
2,2,2
Now if the particular prime number is 3 then you should print the number of occurrences as 2

Q17) Problem statement:


Write a Java program to extract the date, and time from the date string.

Q10) Problem statement


Deepa was ready to make a sketch for a rangoli, In her design, there is a square inscribed in her
square. The edges of the inner square meet the center point of the sides of the outer circle.

She knows only about the number of points needed to draw one side of the inner square.
Write a program to help her draw the sketch.

Q20) Split the String Using White Space


Problem Description
A character is called a whitespace character in Java if and only if the Character.isWhitespace(char)
method returns true. The most commonly used whitespace characters are ' ', '\t', '\n', '\r' and 'f'. There
are several ways to split a string on whitespace characters. Write a Java program to split a string
Wherever you come across whitespace using string tokenizer.

You might also like