i need a program written in java
Q: Lab Objectives This lab was designed to reinforce programming concepts from Chapter 3 of Java How to…
A: Code : - public class Project5_employee { // Instance variables private String firstname;…
Q: 14. Write a program that implements a two dimensional array using a linked list.
A: We first have to treat the contents of the matrix as the nodes of a link, we need to connect the…
Q: Write a main program to create a stack object of type Integer. Place 7 integers in this Stack.…
A: Answer : in the program I create Bag class for bag array of int you can create direct array also I…
Q: 23) How do you prevent a field or a method of any class from inheriting to sub classes?
A: We need to discuss how to prevent a field or a method of any class from inheriting to sub-class.
Q: e given functions by their asymptotic )ifi≤j.
A: Solution - In the given question, we have to find the order of given functions by their asymptotic…
Q: 15.) What is printed by the following code fragment? int i = 3; int j = 2; while (i != 0 && j != 0 )…
A: The given code is in Java.
Q: 13) Write a method called allLess that accepts two arrays of integers as arguments, and returns true…
A: Step-1: StartStep-2: Declare two array arr1 and arr2, initialize with {45,20,300} and…
Q: formal explanation of the programming language known as Java.
A: Introduction: Java: Java is a general-purpose, object-oriented programming language that was…
Q: Give name of 10 reserved words in Java Programming?
A: Question wants names of Reserved words in java.
Q: Write the output produced by the method when it is passed this ArrayList: [5, 17, 23, -7, -3, 11,…
A: The required output and its code with a screenshot have been provided in the next step.
Q: Q2: Fill in the blank. 1. Default value of any reference variable is
A: Given: Any variable's default value is.
Q: Java programming Chapter 4 question 2: Why am i getting this error message and how do i fix it?
A: Step 1: Declare class Lease with the fields tenantName, aptNum, rent and term. Define default…
Q: 1.) How many String objects are created when the following code executes? String namel = new…
A: For the above java code how many string object are created
Q: If I declare a final double, what is the convention for capitalizing the identifier in Java? Give an…
A: Final is a non-access modifier applicable only to a variable, a method, or a class. When a variable…
Q: Example: Parameter style JAVA procedure with XML parameters This example shows the following: •…
A: Code to create a parameter style JAVA procedure with XML parameters CREATE PROCEDURE xmlProc1 ( IN…
Q: 4) Trace the evaluation of the expressions and give the resulting values. (Make sure to give a value…
A: Precedence of Operator : When there are Two or More than Two operator in a algebric expression than…
Q: Create a java program that will ask the user to input number of elements in an array and store the…
A: import java.io.*;class FindArray{ int a[]; int n; BufferedReader ad = new BufferedReader(new…
Q: drawTriangle Write a method called print Triangle that takes an integer numStars and prints a…
A: Logic:- read n from user. Iterate from i=n to i>0 Iterate from j=0 to j<i…
Q: 18)What is the output of the following method?
A:
Q: 1) Write a static method named computeOddSum that is passed an array of int's named numbers. The…
A: SOURCE CODE // NOTE : Save this code as Main.java to compile and execute the program. // Main runner…
Q: Lab Objectives This lab was designed to reinforce programming concepts from Chapter 6 of Java How to…
A: The complete JAVA code is given below with output screenshot
Q: 1. Write a program to generate the following 6x6 matrix. In order to generate the matrix, program…
A: CODE: import java.util.*; public class Main{ public static void main(String[] args) { int[][] a =…
Q: Task: Write a complete runnable Java program named Census (including the class definition and main…
A: The java program with the self explanatory embedded comments is given below: import java.util.*;…
Q: 1) Which of the following statements a. int c = 20 + (int) (Math.random () * 100); generates a…
A: Solution: 1) d a. int c = 20 + (int) (Math.random() * 100); it will generate a random number…
Q: Continued from Question 8: Draw an inheritance hierarchy chart showing all classes having "is a"…
A: Given classes: Product Computer Book Dog Person Cat Pets
Q: Write a static method called removeMatches that removes extra copies of a value that are adjacent to…
A: Here, the JAVA code is as follows: CODE: import java.util.ArrayList;import java.util.List;import…
Q: 12)Write nested for loops to produce the following output: 1 22 333 4444 55555
A: logic:- set space count=5 iterate from i=1 to i<=5 iterate from k=1 to k<=space…
Q: Write a Java method countSubStr() that takes two strings as parameters, and returns the number of…
A: Answer:- import java.io.BufferedReader;import java.io.InputStreamReader;import…
Q: 5. Write a program that computes the spherical distance between two points on the surface of the…
A: java code: public class Test { static double compute(double lat1, double lon1,…
Q: Create a Java program with a student Class . With Constructor of arguments: o Name (in string) •…
A: Class:Class is a collection of data members and member functions.Data members are the variables that…
Q: Clump Finding Problem (1E): Find patterns forming clumps in a string. Input: A string Genome, and…
A: Here a string genome is given we have to find the specific repetition of the pattern in the given…
Q: 18)(True/False) All objects created from a particular class must always take up the same amount of…
A: The answer of this question is as follows:
Q: Answer all questions in java
A: A hard-real-time system is one in which the system must meet all deadlines without fail. Typically,…
Q: Exercise to be evaluated: The source code for the following exercise must be checked off by your…
A: Here is an example Java code that implements the SpanishDictionary program based on the given…
Q: Write Java code that will use Binary Search method to search for a character . Insert random…
A: Required:
hello
i need a program written in java
Step by step
Solved in 4 steps with 3 images
- Question: Write program that asks the user to enter car information for 3 cars. The user will read the car plate number, driven mileage and number of months since last service. The program should display the message ‘Car is due for service’ if one of the following is true: The car drove more than 5000 KM The program should also count and display the number of cars due for service. Input/Output example: Enter car plate number: 600600 Enter the mileage and number of months since last service: 5230 Car is due for service Enter car plate number: 600666 Enter the mileage and number of months since last service: 5002 Car is due for service Enter car plate number: 600222 Enter the mileage and number of months since last service: 1500 The number of cars due is: 2The date June 10, 1960, is special because when we write it in the following format, the month times the day equals the year: 6/10/60 Write a program that ask the user to enter a month in numeric format, a day and a two-digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is Magic. Otherwise, it should display a message saying the date is not Magic. Output should look as shown below. Create test data and place in a file. Name the code file Last Name + First Initial + "-MagicDates.s", for example "SmithJ- MagicDates.s". Name the test data file in a similar manner. Upload the program and test data files to the Dropbox. 6/10/60 is Magic! 6/10/70 is not Magic. 2/11/22 is Magic!Python Programming
- QuestionAn online book club awards points to its customers based on the number of books purchased each month. Points are awarded as follows: Books Purchased Points Earned 1 5 2 15 3 30 4 or more 60 Write a program that asks the user to enter the number of books purchased this month and then displays the number of points awarded.The Café Noir Coffee Shop wants some market research on its customers. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more than 5 digits) or an invalid age (defined as less than 10 or more than 110), the program reprompts the clerk continuously. When the clerk enters fewer than 1 or more than 12 items, the program reprompts the clerk two more times. If the clerk enters a high value on the third attempt, the program accepts the high value, but if the clerk enters a negative value onthe third attempt, an error message is displayed and the order is not counted. At the end of the program, display a count of the number of items ordered by customers from the same zip code as the coffee shop (54984), and a count from other zip codes. Also…
- Remaining Time: 1 hour, 14 minutes, 07 seconds. Question Completion Status: QUESTION 11 Write a Java program that prompts the user to enter the monthly salary amount of an employee in OMR and then deduct a 29% amount as a provident fund from the monthly salary. Calculate, a. Monthly deduction amount = Monthly Salary Amount * percentage of deduction b. Monthly Net salary amount = Monthly Salary Amount – Monthly Deduction amount c. Calculate and display the Annual Net salary amount in OMR and Annual deduction amount in OMR. T T T Arial v 3 (12pt) 回i ン Save All A TOSHIBA 101. Write a program that prompt the user to enter product unit price and quantity purchased. The program will then calculate the sale tax as 5% of the sale amount. When you prompt for the unit price, do not let the user proceed until a number between 1 and 1,000 has been entered. When you prompt for quantity purchased, do not proceed until the user has entered a non-negative value. After a valid purchase is entered then the program will display a purchase's details (unit price, quantity purchased, sale tax, and total cost). Use loop to continue prompting you for your purchase information and calculate/display purchase details until you enter a 'n' or 'N' when prompted. Image Source: www.istockphoto.com 2. Write a multiplication table program that accepts a multiplication base number as well as the low and high values for the range of multipliers. It then constructs a multiplication table for the base number from the low number to the high number. If the base number is 5, the low number…Problem: A small company needs an interactive program to compute an employee’s paycheck. The payroll clerk will initially input the data, and given the input data, an employee's wage for the week should be displayed on the screen for the payroll check. The data for the employee includes the employee's hourly pay rate and the number of hours worked that week. Wage is equal to the employee's pay rate times the number of hours worked (up to 40 hours). If the employee worked more than 40 hours, wage is equal to the employee's pay rate times 40 hours plus 1½ times the employee's pay rate times the number of hours worked above 40. Instructions: Match the action at the left-side with the correct step number at the right-side (the attached picture). Note that it may be possible to group more than one related actions in the same logical step / process without altering the essence of the algorithm. In the program flow, input and checking of hourly pay rate should come before that of the number…
- Answer this question Write a program that calculates and displays a person’s body mass index (BMI). The BMI is often used to determine whether a person with a sedentary lifestyle is overweight or underweight for his or her height. A person’s BMI is calculated with the following formula:BMI = weight × 703 / height2where weight is measured in pounds and height is measured in inches. The program should display a message indicating whether the person has optimal weight, is underweight, or is overweight. A sedentary person’s weight is considered to be optimal if his or her BMI is between 18.5 and 25. If the BMI is less than 18.5, the person is considered to be underweight. If the BMI value is greater than 25, the person is considered to be overweightC#The date June 10, 1960, is special because when we write it in the following format, the month times the day equals the year. 6/10/60 Write a program that asks the user to enter a month (in numeric form), a day, and a two- digit year. The program should then determine whether the month times the day is equal to the year. If so, it should display a message saying the date is magic. Otherwise, it should display a message saying the date is not magic. Input Validation: Think about what legal values the program should accept for month and day.