Implement Method getPercentage that takes two inputs : grade and totalGrade and outputs the grade percentage as follows: percentage = (grade/total grade)*100 . (Assume a student can not get a grade above 100%). In the main method use a scanner object to read the grade and total grade from a text file then pass them to the getPercentage method. The getPercentage method should throw: 1. An IllegalArgumentException that is handled by its caller in case If grade or total grade is a negative number. 2. An ArithmeticException that is handled by its caller in case If total grade is zero (division by zero).
Q: When it comes to data transmission, character devices are often faster than block devices. What do…
A: The answer of this question is as follows:
Q: FIRST NAME LAST_NAME SALARY John Russell 14000 .4 Karen Partners 13500 .3 Alberto Errazuriz 12000 .3…
A: NOTE: Here student mentioned list employee managed by each manager. so here I am using manager id to…
Q: In what way does the first compound notation differ from the other compound notations?
A: Introduction: A compound is always made up of the same components in the same proportions as its…
Q: Without using arrays(to store the integers/digits) and built-in methods(in doing the reverse), write…
A: Find the required code in python as language not mentioned and output given as below :
Q: In a given statement such as int assign[5] = {100, 95, 80}; what array operation is being…
A: The answers can find in the below steps.
Q: Draw a figure to show How a modern computer system works
A: This is a how a modern computer system works:
Q: Write a JAVA program that reads one line of input text and breaks it up into words. The (solution)…
A: Program is: import java.util.*; import java.util.Scanner; //Defining class Words public class Words…
Q: There must be a reason why using virtual memory in embedded systems is so challenging.
A: Introduction: Virtual memory helps applications and hardware memory talk to each other by giving…
Q: When and how to utilise implicit heap-dynamic variables, and why
A: Introduction When and how to utilize implicit heap-dynamic variables, and why.
Q: Is the statement tautology, contradiction, or contingency? (p^q)→r (~p^~q)
A: Answer: Tautology: If the given proposal is provided you with a favorable outcome in every row then…
Q: Do not use Swing for the console output--the console output must be displayed in the console. Write…
A:
Q: Given the following array, int num[5]={3,6,9,12,15}, what will be the value of score for the given…
A: The given array is, int num[5] = {3,6,9,12,15} In array all the elements are at a index, from which…
Q: lowchart of this pseudocode using online chart
A: Due to the rules given to us, I can solve only one question at a time. So, the flowchart of the…
Q: Consider the following problem: Long Enough Cycle Input: undirected simple graph G = (V, E) with |V|…
A: YTHON CODE:- from sys import maxsizefrom itertools import permutationsV = 4
Q: Commonly used filter commands for formatting data in pipes include sed and awk. There are two ways…
A: Introduction: awk – this command is a valuable and powerful pattern matching and text processing…
Q: Which compiler phase would give you an error notice if you attempted to add an integer to a…
A: Introduction: Compiled programs written in a high-level language are converted into equivalent…
Q: What is a database audit trail, Extended Events in SQL Server Computer science
A: Introduction: In SQL Server, a database is made up of a series of tables that each hold a specific…
Q: What if someone installs a pair of antennas that interfere with your point-to-point link between two…
A: Introduction: You may blow out the transmitter depending on the radio. What if someone installs a…
Q: What are programmable devices? Discuss how they are integrated or implemented in the industry and…
A: INTRODUCTION: A programmable logic device (PLD) is an electrical component that may be used to…
Q: Why was an alphanumeric number system referred to as a hexadecimal number system?
A: Introduction It is known as hexadecimal to refer to the numeral system that has a base of 16. As a…
Q: 4. (a) Design an asynchronous 4-bit Binary Coded Decimal (BCD) count-up counter using JK flip-flops.…
A: Here i make a simple truth table :…
Q: In programming, a for construct is used to create a loop that processes a list of items. In order to…
A: Introduction: When it comes to programming languages, constructs are essential mechanisms for the…
Q: A command-line interface or a graphical user interface? Why?
A: ANSWER:-
Q: Given numbers = (18, 96, 71, 95, 32, 66, 85), pivot = 96 What is the low partition after the…
A: Answer: Given Number =(18,96,71,95,32,66,85) and pivot=96 so we have to find after pivot element…
Q: (C++)Write a program that will allow a student to compute for his equivalent semestral grade. The…
A: C++ program to calculate the equivalent semester grade
Q: nter-relati
A: Introduction Human-computer interaction (HCI) is a multidisciplinary study field that focuses on…
Q: What are the most effective methods for assuring the resilience and availability of a LAN network?
A: Introduction: (Local Area Network): The network that connects two or more computers. An example of a…
Q: What distinguishes channel I/O from interrupt-driven I/O?
A: Channel I/O: The I/O takes place by a smart type of Direct Memory Access (DMA) interface known as…
Q: Initially, why was RISC architecture recommended?
A: INTRODUCTION: An Instruction Set with Fewer InstructionsA computer is a form of microprocessor…
Q: ct-oriented, and agile development methods: what's the difference? Is there an approach that you…
A: Structured, object-oriented, and agile development methods: what's the difference? Is there an…
Q: Assume that every 18 months, the number of CPU cores available is doubled. How much extra off-chip…
A: Introduction: Each CPU core may support a maximum of two threads. In this case, a CPU with two cores…
Q: I'm looking for a PKES system, and I'm not sure where to start looking.
A: Introduction: A Passive Keyless Entry and Start (PKES) technology is often seen in high-end…
Q: How did Ubuntu get its start as a branch of another Linux distribution?
A: Introduction: He came up with the idea for of the Ubuntu Foundation in 2004. He was born in South…
Q: Discuss the process of program translation in a programming language.
A: Let us see the details about program translation,
Q: Because virtual memory isn't widely employed in embedded devices.
A: Because virtual memory isn't widely employed in embedded devices. Answer: virtual memory isn't…
Q: What distinguishes business SSDs from SSDs used for laptop computers?
A: Difference between Business SSDs and SSDs for laptop computers An enterprise Solid State Drive…
Q: Write a program will then ask for the prelim grade, midterm grade and final grade of the student.…
A: The program is written in python.find the program in below steps.
Q: In a computer, what are the three most fundamental parts?
A: A machine is made up of a few essential components. These include hardware, applications,…
Q: In computing, an application programming interface (API) is referred to as "programming language."…
A: Introduction: Through an application programming interface, or API, companies can make their data…
Q: Character devices are usually faster in transmitting data than block devices. Is this statement true…
A: Introduction: Character devices, like as tape drives or serial ports, do not have physically…
Q: Discuss CSMA/CA and CSMA/CD. Explain the function of each of these, as well as the type of network…
A: CSMA (Carrier Sense Multiple Access) is a method for controlling communication when more than one…
Q: In programming, a for construct is used to create a loop that processes a list of items. In order to…
A: Introduction: A true statement is true in all situations or at the very least in the sample case.…
Q: Daemon processes cannot be seen with the ps command alone; instead, the –e option must be used in…
A: Introduction: To list system processes, which option is used with the PS command? In addition to…
Q: When it comes to embedded systems, watchdog clocks are critical.
A: To explain when it comes to embedded systems watchdog clocks are critical.
Q: What should be the output from the function below? void display(void) {…
A: Ans: The output from the function below is: void display(void) { int i;…
Q: The creation of the RISC architectural paradigm
A: RISC Creation: The emphasis on "reduced instructions" prompted the it being known as a "reduced…
Q: Compare and contrast the application protocols SMTP and HTTP. What is HTTP and how it works? What…
A: The HTTP and SMTP both are application layer protocol. HTTP stand for Hyper Text Transfer Protocol,…
Q: Identify and explain the three (3) main components of HCI.
A: HCI or Human computer interaction is a technological study, which suggest how the computer and…
Q: Give the definition of the following emerged technologies, provide a sample application and…
A: Artificial intelligence is an area of computer science that emphasizes the creation of intelligence…
Q: According to us, Flynn's taxonomy should be expanded by one level to include this. What…
A: Introduction: Flynn's taxonomy is a classification system for parallel computer architectures.…
i need the code in java and and use text file to get the data from it and save the data on it
Step by step
Solved in 3 steps with 1 images
- Check this code for this assignment: It runs successfully on Netbeans IDE but there is no output.// Create a Scanner object to read user input Scanner input = new Scanner(System.in); // Prompt the user to enter the street number System.out.print("Enter street number: "); int streetNumber = input.nextInt(); input.nextLine(); // Prompt the user to enter the street name System.out.print("Enter street name: "); String streetName = input.nextLine(); // Prompt the user to enter the number of rooms in the house System.out.print("Enter number of rooms: "); int numRooms = input.nextInt(); input.nextLine(); // Create an array to store the room types String[] roomTypes = { "living", "dining", "bedroom1", "bedroom2", "kitchen", "bathroom" }; // Create an array to store the area of each room int[] roomAreas = new int[6]; // Prompt the user to enter the area of each room…For this exercise, you will create 2 classes: InputOutput class and AddNumbers class. ⦁ InputOutput Class: write a program that carries out the following tasks:⦁ Create an object of type PrintWriter and that writes into a file with the name greeting.txt.⦁ Print the message “Hello, world!” on the file.⦁ Close the file.⦁ Open the same file again.⦁ Read the message into a string variable (hint: use nextLine() method to read the text).⦁ Print the message on the screen. ⦁ AddNumbers Class: write a program that asks the user to input four floating-point numbers. Add all correctly specified values and print the sum when the user is done entering data. Use exception handling to detect improper inputs. For example, the user might enter letters instead of numbers. In this case, use the exception handling mechanism to print a proper message. (hint: use InputMismatchException) Don’t forget to import java.util.*.Computer Science Consider a look-up service for the television shows on a given date. A file contains information about these shows. Each show’s data appears on two lines. The first line gives the name of the station, the channel, the name of the show, and a rating. These entries are separated by tildes (~). The second line briefly describes the show. Write pseudocode for a method with the header public void readFile(Scanner data) to read the file into a dictionary that will be searched. Decide what data should be the search key and what should be the associated value. Design any classes needed for the key and the value. Write pseudocode for the method Do not write any code for the answer. Use UML, pseudocode, and written Description.
- Using switch statements, build a Java class file to calculate the area of a figure (call it Area.java). The figure may be acircle or a squareor a rectangle. The user will enter the type of figure they want through a Scanner object. It theyenter “Circle”,proceed to calculate the area of a Circle using values your request for radius. If they enter an“Square”, thencalculate the area of the circle using values you request for side. If they enter an “Radius”, thencalculate usingvalues you request for height and width.Write a program that prompts the user to enter the numberof students and each student’s name and score, and finally displays the name ofthe student with the highest score. Use the next() method in the Scanner classto read a name, rather than using the nextLine() method.for the class ArrayAverage write a code that calculates the average of the listed numbers with a double result for the class ArrayAverageTester write a for each loop and print out the result
- Task 5: ScanningMoney.java Write a program that reads User Input using the Scanner class. Your program should ask the user how many quarters, nickels, dimes, and pennies they have, then display the total amount in dollars. This can be done in main method. Expected Output The highlighted text denotes text that you type into the console yourself. It is not printed by the program. Due to floating point values being used your answer may have the trailing 1 or not. ----JGRASP exec: java ScanningMoney Quarters: 4 Dimes: 3 Nickels: 2 Pennies: 1 You have $1.4100000000000001 ----JGRASP: operation complete.Hi can I get help for java code for this project Part 1 of this project is basically concerned with completing methods printAllAnimals() and readDataFromFile(). The readDataFromFile() method uses a FileDialog object so that you can easily select a file to read data from, but the code for reading the data is missing. However, if you create a MyZoo object and execute the readDataFromFile() then you should see a message stating that 10 animals have been read from the file (but remember that a common problem is that the "open file" dialog gets hidden behind other windows). It doesn't matter which input file you select as no data is read from the file, instead some "temporary" code will "populate" the zoo. After executing readDataFromFile(), if you next execute the printAllAnimals() method then only a "header" will be printed -- it will not actually show any animals as this method is also incomplete. Proceed by completing the following stages. Note that no changes should be needed for class…Make a file named Rectangle.java, in that file create a following methods: //Ask the user for the length of the rectangle. public static double getLength(Scanner keyboard) //Ask the user for the width of the rectangle public static double getWidth(Scanner keyboard) //Calculate the area of the rectangle public static double getArea(double length, double width) //Display the information about the rectangle public static void displayData(double length, double width) Write the code in java and use test case # as an example result.
- Make a file named Rectangle.java, in that file create a following methods: // Ask the user for the length of the rectangle. public static double getLength(Scanner keyboard) // Ask the user for the width of the rectangle public static double getWidth(Scanner keyboard) // Calculate the area of the rectangle Public static double getArea(double length, double width) // Display the information about the rectangle public static void displayData(double length, double width) Write in java and use test case # as an example result.JAVA PPROGRAM Please Modify this program with further modifications as listed below: ALSO, take out and change the following in the program: System.out.println("Program terminated."); because the test case does not need it And change this in the program: Please enter the file name or type QUIT to exit:\n so it reperats once for every test case because it repeats twice in every case as shown in the screenshot. I only need it once. I have provided the failed the test cases and the inputs as a screenshot. The program must pass the test case when uploaded to Hypergrade. import java.io.*;import java.util.ArrayList;import java.util.Scanner;public class SymmetricalNameMatcher { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String fileName; do { // Prompt the user to enter a file name or 'QUIT' to exit. System.out.print("Please enter the file name or type QUIT to exit:\n"); fileName =…Java Programming: Below is the lexer, shank and token files along with the shank.txt file. The shank file is the main method file. The lexer must break up the input text stream into lexemes and return a token object for each one in the shank.txt file. Make sure to fix the errors in the lexer.java file and show the complete code for lexer.java.There must be no error in the code at all. Run the whole code and show the output which the shank.txt must be printed out in the terminal. Attached is the rubric. Lexer.java package mypack; import java.util.HashMap;import java.util.List;import mypack.Token.TokenType; public class Lexer { private static final int INTEGER_STATE = 1;private static final int DECIMAL_STATE = 2;private static final int IDENTIFIER_STATE = 3;private static final int SYMBOL_STATE = 4;private static final int ERROR_STATE = 5;private static final int STRING_STATE = 6;private static final int CHAR_STATE = 7;private static final int COMMENT_STATE = 8; private static final…