Programming Exercise 3-9 Instructions Insurance.java 1 import java.util.Scanner; class Insurance { public static void main (String args[]) { // Write your code here The Harrison Group Life Insurance company computes annual Lal policy premiums based on the age the customer turns in the current calendar year. The premium is computed by taking the } </> decade of the customer's age, adding 15 to it, and multiplying by public static int calculatePremium(int curr, int birth) { // Write your code here 20. For example, a 34-year-old would pay $360, which is calculated by 10 } adding the decades (3) to 15, and then multiplying by 20. 11 Write an application that prompts a user for the current year then a birth year. Pass both to a method that calculates and returns the premium amount, and then display the returned amount. An example of the program is shown below: Enter the current year >> 2020 Enter the birth year >> 2001 The premium is $320
Q: Write the sum -3+5 – 7+9 – 11+ 13 – 15 + 17 – 19 +21 using sigma notation. The form of your answer w...
A: Given series is, -3+5-7+9-11+13-15+17-19+21 This series contains the odd numbers one one starting fr...
Q: What is the maximum number of bits in PC that can change as a result of executing the MIPS instructi...
A: Ans: What is MIPS It could be a method of determining a computer's processor's raw speed. The MIPS e...
Q: In a few words, describe dynamic memory allocation.
A: Dynamic memory allocation is the allocation of the memory by the program at runtime. In simple scena...
Q: What are the three primary roles of database administration?
A: Introduction: Maintenance is handled by Database Administrators, which involves monitoring servers, ...
Q: Can someone teach me how to use the Powershell to populate(at least 10 new users should be created) ...
A: First, we need to make sure that we have a list of all the ten users we need to create. The most imp...
Q: 5. Write a program to read the size and the elements of a square matrix. Rotate the ih row elements ...
A: SUMMARY: -Hence, we got the output.
Q: Create two variables (v1, v2). First and second ones should be your name---surname (string) and facu...
A: Operators are the building blocks of any program, and they're used for everything simple count to co...
Q: Queue from Two Stacks 1.Show how to implement an unbounded queue (with operations enqueue and dequeu...
A: a. Show how to implement an unbounded queue using two unbounded stacks write pseudocode and an argum...
Q: What exactly is file handling, and why is it required? Explain in depth
A: Introduction: In programming, we may need to create some certain input data a number of times. It is...
Q: Write a Python program that takes a String as input from the user, removes the characters at even in...
A: Introduction: Write a Python program that takes a string as input from the user, removes the charact...
Q: Construct a Java program to provide a file named file.txt if it does not exist. Write 100 integers ...
A: I give the code in Java as per your requirement along with output and code screenshot
Q: Bad News Bearers Introduction There is some bad news to be delivered, and X has taken on the dange...
A: Answer: Step 1(INTRODUCTION) This is a basic programming problem named "Jospehus Circle" Since the...
Q: Write a C program that will start an editor process, get its PID, wait 3 seconds, and terminate the ...
A: Given :- Write a C program that will start an editor process, get its PID, wait 3 seconds, and termi...
Q: Consider a process that contains 3 threads and suppose each thread consists of exactly 4 steps. Comp...
A: Given Data : Number of threads(n) = 3 Number of steps in each thread(m) = 4
Q: m + n = 2k + 2k = 4k therefore adding even numbers always gives an even number. The above is wrong ...
A: Yes , As we know that adding of two even is always a even number
Q: Reliability and Usability are important software quality attributes. Give a brief explanation of bot...
A: Note: As per our guidelines we are supposed to answer only one question. Kindly repost other questio...
Q: What are the most critical tasks in data preprocessing?
A: Introduction: Data preparation is the process of converting raw data into an understandable format. ...
Q: Who was it that first proposed the relational model?
A: Edgar Codd was the first person who proposed the relational model.
Q: What are the dashboards available in sage accounting
A: Answer: Accountant's Dashboard: If you are an accountant, another dashboard will be available for se...
Q: What are the drawbacks of file management systems?
A: Introduction: A file processing system is a collection of files and applications that is used to acc...
Q: Q: Describe the definition, advantages and disadvantages of the following databases (In your own wor...
A: INTRODUCTION: We need to tell about the definition and pros and cons. Only 3 parts are be entertain...
Q: Write a C Program that takes an input (2 text.txt) files, and counts the number of times the element...
A: code #include <stdio.h> #include <string.h> int main (){ FILE* file = fopen("filea...
Q: Bourne/Bash shell) a) Write a shell script that checks to see if your PATH environment variable con...
A: ach shell session keeps track of its own shell and environmental variables. We can access these in a...
Q: a) What are the contents of 'otherList after a single iteration of the outer loop of 'bubbleSort? b)...
A: Code: def bubbleSort(list): count=0 for i in range(0,len(list)-1): #outer loop count +...
Q: Consider the First Come First Serve (FCFS) algorithm for the scheduling of three processes A, B, C. ...
A: Turnaround time: To calculate turnaround time subtract Completion time with arrival time of desired ...
Q: Question 2 Which of the following is the proper recursive case for the following function int Recurs...
A: Note: Valid recursive call must lead to termination condition or base case in the given function : t...
Q: Communication is immediate in asynchronous telecommunication Group of answer choices True False
A: Communication is immediate in asynchronous telecommunication Group of answer choices True False i...
Q: Create your own each title appropriate to the given activity. Don't answer the questions just create...
A: Title of the first activity is To analyze the volume of centavo Coins.
Q: hb117guxbs:./nyahell nyshell> exec 1s myahall: startinge ahild pid 7971 ayshell myahell.c yahe1l> tr...
A: Given 2:08 0 • X A CS511 Pro... < 1:1 faculty.wiu.edu Part 1 The structure of your program should...
Q: Discuss the data structure queue and its fundamental operations. Give an illustrative example
A: Ans: The queue in data structure is a linear type datastructure and that is the linear collection of...
Q: Hardware has become less expensive over time. This is particularly true when it comes to hard disk c...
A: Introduction: A disc quota is a limit set by a system administrator on current operating systems tha...
Q: (a) How are RAM and ROM different? (b) What are RAM and ROM?
A: ROM is the meaning of Read Only Memory.
Q: What are the many types of interactions that DBMS can accommodate?
A: Dear learner , hope you are doing well , I will try my best to answer this question. Thank You!!
Q: Create a program that will ask the user how much they would like to tip.
A: using System; using System.Collections.Generic; namespace App { class Program { stat...
Q: Create a code (assembly language) that allows PIC18 microprocessor, which is connected to 7-segment ...
A: The answer is given below.
Q: Determine the function for the number of steps taken by the algorithm. (FOR EACH FUNCTION) Which Big...
A: INTRODUCTION: The function for the number of steps that are to be taken by the algorithms includes ...
Q: What two key pieces of information are needed when creating an image in FTK Imager?
A: These are the key pieces of informaton are needed when creating an image in FTK Imager.
Q: Internal and external file labels tell you what kind of files they are. They are used for what reaso...
A: Labels for filing cabinets The amount of data and information gathered by academics, analysts, compa...
Q: 80x86 Intel Assembly language Write an assembly language to declare all the variables needed in the...
A: Lets see the solution in the next steps
Q: If we know that the CPU is printed and electricity speed can't be changed, how can we change the clo...
A: Introduction: Energy Transitions: The Central Processing Unit-CPU is a term that refers to a compute...
Q: Explain what the term "lifetime of a local variable" means.
A: Introduction: The lifetime of a variable is the amount of time that the variable remains in memory a...
Q: A 5-digit positive integer is entered through the keyboard, write a function to calculatemultiplicat...
A: Given :- A 5-digit positive integer is entered through the keyboard, write a function to calculatemu...
Q: Let G=(V,E) be a graph. Let |V|=n and |E|=e. What is the complexity of BFS (breadth first search) as...
A: Ans: Let G(V,E) be a graph, Let |V| = n and |E| = e, so the time complexity of the BFS(breadth first...
Q: Identify various types of information systems and explain who uses them
A: Intro Basic types of an information systems are: Management information system Decision support s...
Q: 17. 2D Array Operations Write a program that creates a tw
A: Write a program that creates a two-dimensional array initialized with test data. Use any primitive d...
Q: Figure out how many subnets are available given the following network addresses: 1. 244.0.0/20
A: Below is the answer to above question. I hope this will be helpful for you....
Q: The advancement of database technology should be segmented.
A: Segmentation occurs in your CRM, where your contacts are stored. In order to segment your database, ...
Q: to decimal for
A: Given Binary Number: 1011101 Multiply each digit of the binary integer by the power of two that co...
Q: 3. Write a program that reads an integer between 0 and 1000 and adds all the digits in the integer. ...
A: The Answer is in given below steps
Q: 3. Suppose you are asked to build a database application P for a bicycle rental shop. Assume your da...
A:
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images
- Java Language Please help me fix all the error. I very appreciate it Coding: import java.util.Scanner;public class Main { /*static displayline(); char line; { for (int i = 1; i < line; i++ ) { System.out.println ("_"); } } */ public static void main(String[] args) { System.out.println("Clinic Management\n"); int PatAge, Pnumber,age; int cmedicine, cost, Pcost, total, newTotal; String PatName, Pgender, Pdisease, Pmedicine; char typeofmedicine; Scanner scan = new Scanner(System.in); System.out.println("Patient Name :"); String name = scan.next(); name = name + scan.nextLine(); System.out.println("Patient Age :"); age = scan.nextInt(); System.out.println("Patient Gender :"); String gender = scan.next(); System.out.println("Patient Phone Number :"); Pnumber = scan.nextInt(); System.out.println("Patient Disease :" ); String disease =…Jordan University of Science and TechnologyCS415 Contemporary Programming TechniquesMidterm Exam – Second semester 2021Name: ID: Section:Important note: your code must compile correctly and run without errors.Otherwise your code will get the grade zero.Question 1: Implement a java class called ParsingCustomerRecords that has thefollowing data members and functions:ParsingCustomerRecods- customerRecords: array of strings- result: string variable- recordsNumber: int variable-fileName: string variable+ Constructor(String filename, int recordsNumber)+ void Reader()+ void Executor()+ void showResult()+ String toString()All of the data members are private, and all of the methods are public.Constructor has two parameters which are (1) the file name in which Customers’ recordsare stored, and (2) the number of the records in the file. The constructor functionality is toassign suitable initial values to the fileName and recordsNumber data members. Theconstructor also should instantiate the…JAVA Language: Transpose Rotate. Question: Modify Transpose.encode() so that it uses a rotation instead of a reversal. That is, a word like “hello” should be encoded as “ohell” with a rotation of one character. (Hint: use a loop to append the letters into a new string) import java.util.*; public class TestTranspose { public static void main(String[] args) { String plain = "this is the secret message"; // Here's the message Transpose transpose = new Transpose(); String secret = transpose.encrypt(plain); System.out.println("\n ********* Transpose Cipher Encryption *********"); System.out.println("PlainText: " + plain); // Display the results System.out.println("Encrypted: " + secret); System.out.println("Decrypted: " + transpose.decrypt(secret));// Decrypt } } abstract class Cipher { public String encrypt(String s) { StringBuffer result = new…
- Flight assignment runs but there is no imput values for the user to interact when running the program. Kindly fix this issue.import java.util.*; class Flight { String airlineCode; int flightNumber; char type; // D for domestic, I for international String departureAirportCode; String departureGate; char departureDay; int departureTime; String arrivalAirportCode; String arrivalGate; char arrivalDay; int arrivalTime; char status; // S for scheduled, A for arrived, D for departed public Flight(String airlineCode, int flightNumber, char type, String departureAirportCode, String departureGate, char departureDay, int departureTime, String arrivalAirportCode, String arrivalGate, char arrivalDay, int arrivalTime) { this.airlineCode = airlineCode; this.flightNumber = flightNumber; this.type = type; this.departureAirportCode = departureAirportCode; this.departureGate = departureGate;…Computer Science You are required to develop a small chatting application where two or more friends can communicate each other through messages. Create a class Message which has Date d, and message (string). Provide getters/setters, constructors, toString. Create a class Friend having String name, String contact, email and ArrayList of Messages provide getters/setters, constructors, toString addMessage(Message m) method which will add new message to the list. Provide following options to the user using JFrame. Login which will help user login to the application. View Friends (Display List of All Friends) View Messages ( This should display all message of a Friend) Send message (This should ask for friend name and message match the friend name and write that message to the array list).import java.util.*; public class Car implements Comparable<Car>{ private int m_inventory; // the number of cars of this make/model private String m_make; // the make of a car private String m_model; // the model of a car // Creates a new car. // This takes the inventory as a String but the inventory is // stored in the class as an integer. As a result, you must // convert the inventory to an integer. // This Should also set inventory to 0 if the inventory passed // is not a valid integer. public Car(String inventory, String make, String model) { // TODO: Part 6 - use a try/catch to set inventory to 0 // if the inventory is not a valid integer m_inventory = Integer.parseInt(inventory); m_make = make; m_model = model; } // Returns the inventory of cars of this make/model. public int getInventory() { // TODO: Part 1 } // Increases the inventory by one. public void…
- Java Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A,B,C,D,E" is correct. Each question has one correct answer. Thank you. Part 1 - 3. Given the following code, the output is __. class Base { private int x = 5; }class Derived extends Base { x = 6; }public class Sample { public static void main(String[] args) { int x = 7; Derived d1 = new Derived(); System.out.print(d1.x); }} A. 0B. 5C. 6D. 7E. Error message Part 2 - 4. A class Animal has a subclass Mammal. Which of the following is true? A. class Animal extends Mammal { }B. class Mammal extends Animal { }C. class Animal implements Mammal { }D. class Mammal implements Animal { }E. class Mammal { Animal a1 = new Animal(); }mport java.util.Scanner; public class ParkingCharges { // function to calculate the basic charge using the asked hours static double getBasicCharge(int hours) { if (hours >= 7 && hours <= 8) return 5.50; else if (hours >= 5 && hours <= 6) return 4.50; else if (hours >= 2 && hours <= 4) return 4.00; return 3.00; } // function to return the amount to subtract based on local living and OAP static double getDiscount(String isLocal, String isOAP) { if (isOAP.equals("Yes") && isLocal.equals("Yes")) return 2.0 + 1.0; else if (isOAP.equals("Yes")) return 2.0; else if (isLocal.equals("Yes")) return 1.0; return 0; } public static void main(String[] args) { // create a new Scanner object Scanner sc = new Scanner(System.in); // prompt the user to ask if they are disabled…C# ProgrammingPlease see the attached photo for the instructionsComplete this code: namespace Smoothies{ public class Smoothie { // DO NOT MODIFY THIS FIELD private readonly Dictionary<string, string> _prices = new() { { "Strawberries", "$1.50" }, { "Banana", "$0.50" }, { "Mango", "$2.50" }, { "Blueberries", "$1.00" }, { "Raspberries", "$1.00" }, { "Apple", "$1.75" }, { "Pineapple", "$3.50" } }; // TODO: Implement me! public Smoothie (IEnumerable<string> ingredients) { throw new NotImplementedException(); } /// <summary> /// Ingredients used for the smoothie /// TODO: Implement me! /// </summary> public IEnumerable<string> Ingredients { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }…
- JAVA CODE PLEASE 3. Term by CodeChum Admin Construct a class called Term. It is going to represent a term in polynomial expression. It has an integer coefficient and an exponent. In this case, there is only 1 independent variable that is 'x'. There should be two operations for the Term: public Term times(Term t) - multiplies the term with another term and returns the result public String toString() - prints the coefficient followed by "x^" and appended by the exponent. But with the following additional rules: if the coefficient is 1, then it is not printed. if the exponent is 1, then it is not printed ( the caret is not printed as well) if the exponent is 0, then only the coefficient is printed. Input The first line contains the coefficient and the exponent of the first term. The second line contains the coefficient and the exponent of the second term. 1·1 4·3 Output Display the resulting product for each of the test case. 4x^4Exercise Arithmetic (Command-line arguments): Write a program called Arithmetic that takes three command-line arguments: two integers followed by an arithmetic operator (+, -, * or /). The program shall perform the corresponding operation on the two integers and print the result. For example: java Arithmetic 3 2 + 3+2=5 java Arithmetic 3 2 - 3-2=1 java Arithmetic 3 2 / 3/2=1 Hints: The method main(String[] args) takes an argument: "an array of String", which is often (but not necessary) named args. This parameter captures the command-line arguments supplied by the user when the program is invoked. For example, if a user invokes: java Arithmetic 12345 4567 + The three command-line arguments "12345", "4567" and "+" will be captured in a String array {"12345", "4567", "+"} and passed into the main() method as the argument args. That is, args is: {"12345", "4567", "+"} // args is a String array args.length is: 3 // length of the array args[0] is: "12345"…Exception in thread "main" java.lang.NumberFormatException: For input string: "x" for Java code public class Finder { //Write two recursive functions, both of which will parse any length string that consists of digits and numbers. Both functions //should be in the same class and have the following signatures. //use the if/else statement , Find the base case and -1 till you get to base case //recursive function that adds up the digits in the String publicstaticint sumIt(String s) { //if String length is less or equal to 1 retrun 1. if (s.length()<= 1){ return Integer.parseInt(s); }else{ //use Integer.praseInt(s) to convert string to Integer //returns the interger values //else if the CharAt(value in index at 0 = 1) is not equal to the last vaule in the string else {//return the numeric values of a char value + call the SumIt method with a substring = 1 return Character.getNumericValue(s.charAt(0) ) + sumIt(s.substring(1)); } } //write a recursion function that will find…