Question
Lab1: Q1: Java program to solve quadratic equations (use if, else if and else) Input Data a: 1 b: 5 c: 1 Expected Output The
Lab1:
Q1: Java program to solve quadratic equations (use if, else if and else)
Input Data a: 1 b: 5 c: 1 Expected Output The roots are -0.20871215252208009 and -4.7912878474779195
Q2: Java program that takes a number from the user and checks the input integer between 1 and 7 to display the name of the weekday.
Input Data Please enter a number: 4 Expected Output Wednesday
Q3: Java program to generate the following @'s triangle:
Input Data Input the number: 6 Expected Output
@
@@
@@@
@@@@
@@@@@
@@@@@@ Q4: Java program to declare an array with a name (courseArr) of size 5 and let a student fill it with his courses, and do the following:
- Print all the elements of the array.
- Let the program check if the array has "Java" course.
- Copy the inserted array by the student to another one with a name (copiedArr).
- Print coiedArr backward.
Input Data
Please enter course number 1: C++
Please enter course number 2: Python
Please enter course number 3: Java
Please enter course number 4: PHP
Please enter course number 5: C#
Expected Output
Courses array:
C++ Python Java PHP C#
Java course is in the courses array
Copied array:
C# PHP Java Python C++
Lab2:
(String & Files )
Q1:
Java program that takes from a lecturer (students' phones numbers) and store them to a file named (Students numbers.txt), then do the following:
- Read the numbers from the file, and insert them to a list.
- Check the numbers for which telecom company as follows:
079 | Zain |
078 | Umniah |
077 | Orange |
And print them with company name.
Q2:
Read data from the previous file and rewrite them to another file named (Students numbers2.txt),then print the data line by line in the console
Q3:
Read from the user 10 names and then print them with capitalizing the first letter of each name.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started