1-Declaring and Initializing Java Variables Declaring and Initializing Java Variables Summary In this lab, you declare and initialize variables in a Java program. The program file named NewAge.java, calculates your age in the year 2050. Instructions 1. Declare an integer variable named newAge. 2. Declare and initialize an integer variable named currentAge . Initialize this variable with your current age. 3. Declare and initialize an integer variable named current Year. Initialize this variable with the value of the current year. Use four digits for the year. 4. Execute the program.
Q: What are all to node references pointing to initially? What is the difference between prepend and…
A:
Q: What three requirements must be fulfilled for a network to operate efficiently and effectively? Can…
A: NOTE :- Below i explain the answer in my own words by which you understand it well. An…
Q: Write an x86 assembler program that does the following: a. Gets information (first name and age)…
A: Description: The given code retrieves the input messages "Enter your name" and "Enter your age".It…
Q: Why is it necessary to use a modem to connect a phone line to a communication adapter?
A: 1) Communication adaptor is a port available on computers or any communication device to fascilitate…
Q: What hardware modifications may be made to boost the performance of a single processor?
A: The following actions can be taken to improve the performance of a single processor: (1) Increase…
Q: What are all to node references pointing to initially? What is the difference between prepend and…
A: What are all to node references pointing to initially? What is the difference between prepend and…
Q: 9 Many industries, including education, health care, and commerce, have used relational databases…
A: 1. Relational Database : Relational Database Management Systems-RDBMS. Most people use this…
Q: On the basis of the following three components, a successful and effective network is constructed:…
A: Given: What three factors determine a network's viability and effectiveness? Give a personal,…
Q: What hardware modifications may be made to boost the performance of a single processor?
A: For improving a single processor's performance: - Expand the cache memory's capacity Reduce the…
Q: Explain The LinkedList Constructor with help og python code?
A: The LinkedList Constructor in python :-
Q: Effectiveness and efficiency are two traits a network must possess in order to be deemed to be…
A: The ability to finish a job with the least amount: Of time, money, and effort spent on it, in…
Q: Google has opened a branch in Pakistan. There is an open position available. "What microprocessor…
A: Introduction : Processor (microprocessor): It is the central processing unit of a computer system…
Q: Many factors need to be taken into account while creating an accurate and efficient compiler.…
A: enhancing the compiler: A computer programme known as an optimising compiler aims to minimise or…
Q: Create a java program that generates elements (randomly from 10 – 75) of a 2-dimensional array (5x5)…
A: Your answer is given below...
Q: How precisely is a design for an architectural structure converted into computer code? Explain the…
A: The talk's fundamental concept is that a software system's architecture and code are never entirely…
Q: write a c++ programe :do it by flag Ask user to enter an integer and then determine whether it is…
A: #include <iostream> using namespace std; int main(){ int n; cout << "Type a…
Q: ecial benefits of discrete event simulation?
A: Introduction: Discrete Event Simulation (DES) models the operation of a system as a (discrete)…
Q: please see image for instruction questions here is the HTML sourse code as i could not upload 3…
A: Answer: <!-- The JS Code is listed below the HTML code in the format as you required. -->…
Q: How do tiny PCs work? What are their strengths and weaknesses? What kinds of applications can they…
A: Answer:
Q: How is it possible for a computer to multitask when only one machine is available?
A: As given, below is the explanation that how computer performs multitasking with only one machine.
Q: Using intelligent software design, is it possible to remove errors? Exists a good or negative…
A: Given: An error, defect, failure, or fault in a computer programme or software system is referred to…
Q: Why is it important to check the four crucial Windows settings listed below? Windows antivirus and…
A: Definition: An operating system (OS) is a programme loaded by a boot programme that manages…
Q: Google just opened a new office in Pakistan. You'll be working for us. During the interview, you…
A: The microprocessor: which is a computer system's main component, performs both logical and…
Q: sor/mutator methods Create another child class to represent Faculty. This class will have faculty…
A: the code is an given below :
Q: Describe how the device manager of the operating system manages the efficiency of the system.
A: Operating system An operating system goes about as a middle person between the client of a PC and PC…
Q: Do you anticipate any significant developments in computer hardware in the next 10 years? What…
A: A group of actual computer components is referred to as computer hardware. Do you believe that…
Q: Intelligent modems can automatically dial, hang up, and answer incoming calls. Who is responsible…
A: Modulator-demodulators, sometimes referred to as modems, transform digital information into analogue…
Q: Which brand-new piece of computer hardware do you believe will have the most impact on the computer…
A: Introduction: Components for computers: Hardware refers to all of a computer's physical parts,…
Q: No. List A ALU Linker 1. 2. 3. 4. 5. 6. 7. "Type" in Module PLC Precision 12C Supercomputers RISC C…
A: 1)ALU -F Computational Unit; performs arithmetic and logic operations 2) Linker-G computer…
Q: What three things must a network do in order for it to perform well as a whole? In a few short…
A: Three things must be in a network:- Protocol Software Hardware
Q: A modem links a phone line to a communication adapter. What is the function of this equipment?
A: A modem (modulated/demodulated) also known as a broadband termination unit (BTU) is a networking…
Q: recisely is a design for an architectural structure converted into computer c the process phases…
A: Introduction: The process of defining a collection of hardware and software components, as well as…
Q: Have you any notion what the Compiler Phases' most crucial elements are? Please include…
A: Compiler: A compiler is a special program that translates a programming language's source code into…
Q: architecture would be most suitable for a school or other educational setting? What type of…
A: In this case, a peer-to-peer network is better than a client-server network because all computers…
Q: Given that CPUs are printed and electricity cannot be changed, how can we know what happens if we…
A: Changes in Energy: CPU is an acronym for Central Processing Unit. It might be considered the brain…
Q: ttach compilation aa well.
A: Approach:- Take the energy of the photon from the user in EV and then use the below formula to find…
Q: A modem links a phone line to a communication adapter. What is the function of this equipment?
A: A modem is a piece of hardware that enables a computer to transmit and receive data over telephone…
Q: C++ PROGRAMMING (Linked list) complete the functions: You have to continue on implementing your…
A: C++ Programming which refers to the object oriented programming languages. C++ is also a popular…
Q: ch operating systems have been directly affected by the change to the algorithm used to 2
A: Introduction: A File System is an essential component of an operating system. A File System is a…
Q: How do synthetic neural networks operate?
A: Neural network artificial An artificial neural network is like a computer model made up of a few…
Q: Which operating systems have been directly affected by the change to the algorithm used to remove…
A: Introduction: The key plan objective of Android security engineering is that no application is…
Q: Should we connect the CPU to the memory using an asynchronous or synchronous bus? Which method is…
A: When using synchronous buses, the clock will tick, and any instructions that need to be carried out…
Q: How do tiny PCs work? What are their strengths and weaknesses? What kinds of applications can they…
A: PCS: Mini PCs function like desktop PCs but take up no desk space. They are so tiny that they may be…
Q: Why is it necessary to use a modem to connect a phone line to a communication adapter?
A: Communication adapters are devices that enable communication between computers and other devices,…
Q: Write a FUNCTION with one parameter, a float value called num, that will calculate half of num and…
A: The Answer is:-
Q: What are some of the many metrics used in evaluating the reliability of software?
A: Question: What are some of the many matrices used in evaluating the reliability of Software? Answer:…
Q: cribe the compiler in general and talk about how the progra octod
A: Introduction: Because pcdesignis createdfrom electronic switches and cables which willsolely work…
Q: Do the following: 1. Use your code editor to open the project03-02_txt.html and project03-02_txt.js…
A: Description: Define the project03-02.js file as follows: Use the windows.onload function to defer…
Q: Between a telephone line and a comm adaptor, why is a modem necessary?
A: A modem is connected between a telephone line and a communication adapter: A modem is a device or…
Q: Which three elements are absolutely necessary for a network to function smoothly and efficiently?…
A: The three elements which are necessary for a network to function smoothly and effectively are…
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
- JAVA PPROGRAM ASAP Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade. Also, for test cases 1-4 it wants only to input Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram. Chapter 9. PC #10. Word Counter (page 610) Write a program that asks the user for the name of a file. The program should display the number of words that the file contains. Input…JAVA PPROGRAM ASAP Hypergrade does not like this program because it says 2 out of 7 passed and take out the extra \n from the program. Please Modify and change this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. The program must pass the test case when uploaded to Hypergrade. Also, for test cases 1-4 it wants only to input Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram. import java.io.File;import java.io.FileNotFoundException;import…The FKGLF is: 0.39(totalWords/totalSentences) + 11.8(totalSyllables/totalWords) - 15.59Using the FKGLF and your knowledge of how to input and output text files with Java, write an application that will: Take in a text file (anyText.txt), Correct the spelling then save to another file (anyTextCorrected.txt), Calculate the grade level. Outputs. Your solution needs to return: the number of words in the text, the number of spelling errors corrected with the misspelled words listed, the number of sentences in the text, the number of syllables in the text, and the Flesch-Kincaid Grade Level. One assumption you can make is the accuracy of SpellChecker(). You have access to the Java method SpellChecker that takes in a string, assumed to be a word, and returns a correctly spelled word. (Note: If the word returned is different than the word input, then there was a spelling error.) One Constraint: This program requires two classes: GradeLevel and GradeLevelTest. GradeLevel will be the…
- JAVA PROGRAM Chapter 4. Homework Assignment (read instructions carefully) Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits): Total: nnnnn.nnn Average: nnnnn.nnn Class name: FileTotalAndAverage PLEASE FIX AND MODIFY THIS JAVA SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASES. RIGHT NOW IT SAYS 0 OUT 3 PASSED. THE PICTURES THAT I PROVIDED PROOF THAT WHEN I UPLOAD IT TO HYPERGRADES IT FAILS TEST CASSES. THANK YOU. import java.io.*;import java.util.Scanner;public class FileTotalAndAverage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Please enter the file name: "); while (true) { String fileName = scanner.nextLine(); File file = new File(fileName); if (file.exists() &&…Requested files: InClass02.java, input.txt Maximum number of files: 6 Create a simple java program that reads all the content in a .txt file, the user will enter the filename to be opened. In this case, the file will contain multiple lines of student details with each line containing a single student detail. Your task is to then create a student class that models the firstname, lastname, year of birth and gender of every student. The student class should further be able to assign every student created with a student number using a class variable[format is 2022000X, X is a number such as 1,2..] and be able to calculate the age of each student. Within the driver class add all the students read from file into an ArrayList and then print the first and last student in the list. You are additionally expected to deal with most common exceptions(See samples below) [HINT: DO NOT PROVIDE A PATH BUT RATHER ONLY OPEN THE FILE WITH RELATIVE PATH/FILENAME] Sample run 1: Enter filename:…JAVA PROGRAM Chapter 4. Homework Assignment (read instructions carefully) Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits): Total: nnnnn.nnn Average: nnnnn.nnn Class name: FileTotalAndAverage PLEASE FIX, CHANGE AND MODIFY THIS JAVA PROGRAM SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASES. RIGHT NOW IT SAYS 0 OUT 3 PASSED. THE PICTURES THAT I PROVIDED PROOF THAT WHEN I UPLOAD IT TO HYPERGRADES IT FAILS TEST CASSES. THANK YOU. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.InputMismatchException;import java.util.Locale;import java.util.Scanner;public class FileTotalAndAverage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String fileName; do {…
- COMPUTER SCIENCE 130 JAVA PROGRAM Chapter 4. Homework Assignment (read instructions carefully) Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits): Total: nnnnn.nnn Average: nnnnn.nnn Class name: FileTotalAndAverage double_input1.txt double_input2.txt PLEASE FIX AND MODIFY THIS JAVA SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL TEST CASSES PLEASES. RIGHT NOW IT SAYS 0 OUT 3 PASSED. THE PICTURES THAT I PROVIDED PROOF THAT WHEN I UPLOAD IT TO HYPERGRADES IT FAILS TEST CASSES. THANK YOU. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.InputMismatchException;import java.util.Locale;import java.util.Scanner;public class FileTotalAndAverage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String…JAVA PROGRAM Chapter 4. Homework Assignment (read instructions carefully) Write a program that asks the user for the name of a file. The program should read all the numbers from the given file and display the total and average of all numbers in the following format (three decimal digits): Total: nnnnn.nnn Average: nnnnn.nnn Class name: FileTotalAndAverage double_input1.txt double_input2.txt PLEASE MODIFY THIS CODE, SO WHEN I UPLOAD IT TO HYPERGRADE IT PASSES ALL THE TEST CASES, BECAUSE WHEN I UPLOAD IT TO HYPERGRADE IT DOES NOT PASS THE TEST CASES. IT HAS TO PASS ALL THE TEST CASES. I PROVIDED THE CORRECT OUTPUT AS A SCREENSHOT AS A REFERRENCE. import java.io.BufferedReader;import java.io.FileReader;import java.io.IOException;import java.util.InputMismatchException;import java.util.Scanner;public class FileTotalAndAverage { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String fileName; do {…JAVA PPROGRAM ASAP Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. It does not pass the test cases when I upload it to Hypergrade. Also, for test cases 1-4 it wants only to imput Please enter the file name or type QUIT to exit: then input the file and display the Total number of words. For test cases 5 and 7 it wants to only to input Please enter the file name or type QUIT to exit then input input5.txt and then display File: input5.txt does not exist.\n then display Please enter the file name again or type QUIT to exit:\n then type input1.txt to display the total number of words or type quit to exit the program. For test case 6 it wants only to Please enter the file name again or type QUIT to exit:\n then type quit to exit the porgram. Because RIGHT NOW IT PASSES 1 OUT OF 7 TEST CASES. I have provided the failed the test cases as a screenshot. The program must pass the test case when uploaded to Hypergrade. import…
- Java Proram ASAP There is an extra /n in the program in test case 1-3 and after Please re-enter the file name or type QUIT to exit:\n quitENTER in test case 4 there needs to be nothing as shown in the screenshot. The text files are located in Hypergrade. Please modify this code below so it passes the test cases. Also I have the correct test case as a screenshot. import java.io.*;import java.util.Scanner;public class ConvertText { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); System.out.println("Please enter the file name or type QUIT to exit:"); while (true) { String input = sc.next(); if (input.compareTo("QUIT") == 0) { break; } else { String filePath = new File("").getAbsolutePath(); filePath = filePath.concat("/"); filePath = filePath.concat(input); File file = new File(filePath); if…1. Use Notepad or Textpad to create a file called InputNumbers.txt. Your file should have the following positive integers. 35 45 50 13 24 29 91 47 69 45 78 56 35 68 79 90 80 30 37 58 99 You may create the file with 1 integer on each line or a few integers on each line as shown. 2. Write a Java program that will read the integers in the file until EOF is reached (hint: use a loop). The program should compute and print: the total sum of all the integers read the count of all the even integers read ⚫ the count of all the odd integers read ⚫ the average of all the numbers read 3. Send the output to a file called FileOut.txt 1. Make sure there is one line in the output file for each of output that is printed. In addition, format the average to have two digits of precision after the decimal point.Write a program that uses File I/O (input and output files). This is a Java program. Use a loopIn javas coding please Write a program that opens the salesdat.txt file and processes it contents. The program should display the following per store: The total sales for each week. (Should print 5 values - one for each week). The average daily sales for each week. (Should print 5 values - one for each week). The total sales for all the weeks. (Should print 1 value) The average weekly sales. (Should print 1 value) The week with the highest amount in sales. (Should print 1 week #) The week with the lowest amount in sales. (Should print 1 week #) All Values (Total Sales, Average Daily Sales for Each Week, Total Sales for all Weeks, Average Weekly Sales, Highest Amount in Sales, Lowest Amount in Sales) The file contains the dollars amount of sales that a retail store made each day for a number of weeks. Each line in the file contains thirty five numbers, which are sales numbers for five weeks. The number are separated by space. Each line in the file represents a separate store.…