Answer:
sorry i need points .................
..........................................
Answer:
nice
Explanation:
Answer:
*gasp* OBJ?! I'm honored.
- JAVA - Okay I have been attempting this for the past hour and I am really stuck and keep getting an error... The error says that I keep missing a main thread but its there... help!
Given a main program that searches for the ID or the name of a student from a text file, complete the findID() and the findName() methods that return the corresponding information of a student. Then, insert a try/catch statement in main() to catch any exceptions thrown by findID() or findName(), and output the exception message. Each line in the text file contains the name and the ID of a student, separated by a space.
Method findID() takes two parameters, a student's name and a Scanner object containing the text file's contents. Method findID() returns the ID associated with the student's name if the name is in the file, otherwise the method throws an Exception object with the message "Student ID not found for studentName", where studentName is the name of the student.
Method findName() takes two parameters, a student's ID and a Scanner object containing the text file's contents. Method findName() returns the name associated with the student's ID if the ID is in the file, otherwise the method throws an Exception object with the message "Student name not found for studentID", where studentID is the ID of the student.
The main program takes three inputs from a user: the name of a text file (String), a user choice of finding the ID or the name of a student (int), and the ID or the name of a student (String). If the user choice is 0, findID() is invoked with the student's name as one of the arguments. If the user choice is 1, findName() is invoked with the student's ID as one of the arguments. The main program finally outputs the result of the search or a message if an exception is caught.
Ex: If the input of the program is:
roster.txt 0 Reagan
and the contents of roster.txt are:
Reagan rebradshaw835
Ryley rbarber894
Peyton pstott885
Tyrese tmayo945
Caius ccharlton329
the output of the program is:
rebradshaw835
Ex: If the input of the program is:
roster.txt 0 Mcauley
the program outputs an exception message:
Student ID not found for Mcauley
Ex: If the input of the program is:
roster.txt 1 rebradshaw835
the output of the program is:
Reagan
Ex: If the input of the program is:
roster.txt 1 mpreston272
the program outputs an exception message:
Student name not found for mpreston272
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.IOException;
public class LabProgram {
public static String findID(String studentName, Scanner infoScnr) throws Exception {
/* Type your code here. */
}
public static String findName(String studentID, Scanner infoScnr) throws Exception {
/* Type your code here. */
}
public static void main(String[] args) throws IOException {
Scanner scnr = new Scanner(System.in);
String studentName;
String studentID;
String studentInfoFileName;
FileInputStream studentInfoStream = null;
Scanner studentInfoScanner = null;
// Read the text file name from user
studentInfoFileName = scnr.next();
// Open the text file
studentInfoStream = new FileInputStream(studentInfoFileName);
studentInfoScanner = new Scanner(studentInfoStream);
// Read search option from user. 0: findID(), 1: findName()
int userChoice = scnr.nextInt();
// FIXME: findID() and findName() may throw an Exception.
// Insert a try/catch statement to catch the exception and output the exception message.
if (userChoice == 0) {
studentName = scnr.next();
studentID = findID(studentName, studentInfoScanner);
System.out.println(studentID);
}
else {
studentID = scnr.next();
studentName = findName(studentID, studentInfoScanner);
System.out.println(studentName);
}
studentInfoStream.close();
}
}
Answer:
import java.util.Scanner;
import java.io.FileInputStream;
import java.io.IOException;
public class LabProgram {
public static String findID(String studentName, Scanner infoScnr) throws Exception {
while (infoScnr.hasNextLine()) {
String[] parts = infoScnr.nextLine().split(" ");
if (parts[0].trim().equals(studentName)) {
return parts[1].trim();
}
}
throw new Exception("Student ID not found for " + studentName);
}
public static String findName(String studentID, Scanner infoScnr) throws Exception {
while (infoScnr.hasNextLine()) {
String[] parts = infoScnr.nextLine().split(" ");
if (parts[1].trim().equals(studentID)) {
return parts[0].trim();
}
}
throw new Exception("Student ID not found for " + studentID);
}
public static void main(String[] args) throws IOException {
Scanner scnr = new Scanner(System.in);
String studentName;
String studentID;
String studentInfoFileName;
FileInputStream studentInfoStream = null;
Scanner studentInfoScanner = null;
// Read the text file name from user
studentInfoFileName = scnr.next();
// Open the text file
studentInfoStream = new FileInputStream(studentInfoFileName);
studentInfoScanner = new Scanner(studentInfoStream);
// Read search option from user. 0: findID(), 1: findName()
int userChoice = scnr.nextInt();
try {
if (userChoice == 0) {
studentName = scnr.next();
studentID = findID(studentName, studentInfoScanner);
System.out.println(studentID);
} else {
studentID = scnr.next();
studentName = findName(studentID, studentInfoScanner);
System.out.println(studentName);
}
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
scnr.close();
studentInfoStream.close();
}
}
Explanation:
- You should call your file the same as your class (i.e., LabProgram.java)
- I added a try/catch to both find calls, to catch the exception
- The find methods are very similar, they loop through the lines of the roster, splitting each line at a space and doing string comparison.
Select the correct answer. Nancy has made a small web page with the new features of HTML5. She has to show this web page in school. Which version of Internet Explorer (IE) should her school computer have to support the latest elements of HTML5? ОА. IES OB. IE 10 OC. IE 7 OD. IE 6 hvext Reset
Answer:
IE 10
Explanation:
It is the newest version in the list of options
Microsoft PowerPoint is an example of a(n) _____ application.
1. utility
2. productivity
3. education
4. entertainment
Microsoft PowerPoint is an example of a utility application. Hence, option A is correct.
What is meant by utility application?Utility apps fulfill the user's functional requirements by doing routine tasks that would otherwise need to be done physically. They can be as simple as paying the bills or updating field workers' employment status.
Utility software is software that aids in analyzing, configuring, optimizing, or managing a computer. It maintains the computer infrastructure, as opposed to application software, which is used to carry out tasks that primarily benefit end users.
Database software is not utility software. Examples of utility software include text editors, disc defragmenters, and antivirus programs.
Thus, option A is correct.
For more details about utility application, click here:
https://brainly.com/question/13014396
#SPJ2
Answer: B: productivity
Explanation: I just finished the assignment "PowerPoint is a productivity application that helps companies and students give presentations."
some body help me
how is the relationship between employment and education write in short
Answer:
More education leads to better prospects for earnings and employment.
Which wireless probe is designed to scan and record wireless signals within its range at regular intervals and report the information to a centralized database
Wireless probe are often referred to as a device that is said to monitor the airwaves for RF traffic. A standard wireless device is designed to scan and record wireless signals within its range at regular intervals and report the information to a centralized database
Wireless device probe consist of a standard wireless device, such as a portable laptop computer which at regular intervals, during the normal course of operation, can scan and record wireless signals.Desktop probe are also known as a standard desktop PC that often uses a universal serial bus (USB) wireless network interface card adapter to monitor the RF frequency.
Dedicated probe are made to monitor the RF frequency for transmissions.
Learn more from
https://brainly.com/question/14329343
In the space below, explain how the Table Tools can be accessed
Answer:
Click in the cell (or select multiple cells) that contains text you want to align. The Table Tools tab appears. Click the Layout tab under the Table Tools heading. … If you change the alignment of blank cells, any new text you type in those blank cells will appear according to the alignment you choose.
Explanation:
Answer:
Creating a Table
1) Click the Insert tab on the Ribbon
2) Click on Table
3) Highlight the number of columns and rows you’d like
OR
4) Click Insert Table
5) Click the arrows to select the desired number of columns
6) Click the arrows to select the desired number of rows
7) Click OK
Explanation:
Enter the decimal equivalent of the exponent of the following floating point binary number.
0 00000101 1.00100000000000000000000
Decimal exponent:
Answer:
11.125
Explanation:
The binary numeral system uses the number 2 as its base (radix). As a base-2 numeral system, it consists of only two numbers which are 0 and 1. In order to convert binary to decimal, basic knowledge on how to read a binary number might help. As I cannot share links over Brainly I won't be able to give resources, but usually a simple search will bring up videos / websites that will help!
Hopefully this is correct, have a nice day! :D
Which term describes the process of training a machine to do simple, repetitive tasks, and adapt or correct its performance based on changing conditions at speed and scale?
The ability to perform a specified task, when needed without needing help each time is called an Automation process.
Automaton process is usually attached with the concept of machine learning and Artifical intelligence. Models are developed by training to learn from data and perform repetive actions , without needing to be reprogrammed each time.These models keeps learning and get better as the operation is repeated.
Learn more : https://brainly.com/question/24036383
can you just answer this
Answer:
html there you go it's very noice I'm learning ai
A _____ derives its name from the fact that a collection of multiple entries of the same type can exist for any single key attribute occurrence.
Next, you will implement the reserveAnimal() method. Your completed method should do the following: Prompt the user for input. The user should enter their desired animal type and country. o If there is an available animal which meets the user's input criteria, the method should access an animal object from an ArrayList. If there are multiple animals that meet these criteria, the program should access the first animal in the ArrayList. The method should also update the "reserved" attribute of the accessed animal. o If there is not an available animal which meets the user's input criteria, the method should output feedback to the user letting them know that no animals of that type and location are available. 6. Finally, you have been asked to implement a printAnimals() method that provides easy-to-read output displaying the details of objects in an ArrayList. o To demonstrate this criterion in a "proficient" way, your implemented method must successfully print the ArrayList of dogs or the ArrayList of monkeys. o To demonstrate this criterion in an "exemplary" way, your implemented method must successfully print a list of all animals that are "in service" and "available". import java.util.ArrayList; import java.util.Scanner; public class Monkey extends RescueAnimal{ private String species, tailLength, height, bodyLength; public Monkey (String name, String species, String tailLength, String height, String bodyLength, String gender, String age, String weight, String acquisitionDate, String acquisitionCountry, String trainingStatus, boolean reserved, String in ServiceCountry) { setName(name); setSpecies (species); setTailLength(tailLength); setHeight(height); setBodyLength(bodyLength); setGender(gender); setAge(age); setWeight(weight); setAcquisitionDate(acquisitionDate); setAcquisition Location(acquisitionCountry); setTrainingStatus (trainingStatus); setReserved(reserved); setInServiceCountry(inServiceCountry); } //Accessor and Mutator methods public String getSpecies() { return species; } public void setSpecies (String monkey Species) { species = monkeySpecies; } public String getTailLength() { return tailLength; } public void setTailLength(String monkeyTailLength) { tailLength = monkeyTailLength; } public String getHeight() { return height; } public void setHeight(String monkeyHeight) { height = monkeyHeight; } public String getBodyLength() { return bodyLength; } public void setBodyLength(String monkeyBodyLength) { bodyLength = monkeyBodyLength; } } public class Dog extends RescueAnimal { // Instance variable private String breed; // Constructor public Dog(String name, String breed, String gender, String age, String weight, String acquisitionDate, String acquisitionCountry, String trainingstatus, boolean reserved, String inServiceCountry) { setName(name); setBreed (breed); setGender(gender); setAge(age); setWeight(weight); setAcquisitionDate(acquisitionDate); setAcquisitionLocation(acquisitionCountry); setTrainingstatus (trainingstatus); setReserved (reserved); setInServiceCountry(inServiceCountry); } // Accessor Method public String getBreed() { return breed; } // Mutator Method public void setBreed(String dogBreed) { breed = dogBreed; } }
Answer:
To demonstrate this criterion in a "proficient" way, your implemented method must successfully print the ArrayList of dogs or the ArrayList of monkeys
In the provided code, the reserveAnimal() method prompts the user to enter an animal type and country. It then searches for an available animal in an ArrayList based on the user's input. If a matching animal is found, its "reserved" attribute is updated. The printAnimals() method displays the details of animals in the ArrayList.
import java.util.ArrayList;
import java.util.Scanner;
public class AnimalReservationSystem {
private ArrayList<RescueAnimal> animals;
public AnimalReservationSystem() {
animals = new ArrayList<>();
}
public void reserveAnimal() {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter desired animal type: ");
String animalType = scanner.nextLine();
System.out.print("Enter desired country: ");
String country = scanner.nextLine();
for (RescueAnimal animal : animals) {
if (animal.getClass().getSimpleName().equals(animalType) &&
animal.getAcquisitionLocation().equals(country) &&
!animal.isReserved()) {
animal.setReserved(true);
System.out.println("Animal reserved successfully!");
return;
}
}
System.out.println("No animals of that type and location are available.");
}
public void printAnimals() {
System.out.println("Animal Details:");
for (RescueAnimal animal : animals) {
if (animal instanceof Dog) {
Dog dog = (Dog) animal;
System.out.println("Name: " + dog.getName());
System.out.println("Breed: " + dog.getBreed());
System.out.println("Gender: " + dog.getGender());
System.out.println("Age: " + dog.getAge());
System.out.println("Weight: " + dog.getWeight());
System.out.println();
} else if (animal instanceof Monkey) {
Monkey monkey = (Monkey) animal;
System.out.println("Name: " + monkey.getName());
System.out.println("Species: " + monkey.getSpecies());
System.out.println("Tail Length: " + monkey.getTailLength());
System.out.println("Height: " + monkey.getHeight());
System.out.println("Body Length: " + monkey.getBodyLength());
System.out.println();
}
}
}
// Other methods and code
}
To learn more on Java click:
https://brainly.com/question/2266606
#SPJ2
9.1 a. What is a device register? b. What is a device data register? c. What is a device status register?
(a) A device register is a register (or memory location) that is used for data transfer
to/from an input/output device. It provides a means of communication between the
processor and the input/output device. The processor can poll this register to find out
whether it has received an input or it can send an output from/to the specific device that the device register belongs to. In memory mapped I/O device registers are dedicated memory locations for each I/O device. There may be more than one device register (dedicated memory location) for one device.
(b) A device data register is a device register (a dedicated memory location in
memorymapped I/O) that holds the data that is to be input/output.
(c) A device status register is a device register (a dedicated memory location in
memorymapped I/O) that indicates the status of the input/output. It allows for the
processor to know whether or not input/output of the value in the device data register has occurred. Basically it is an important step to achieve synchronization in an asynchronous I/O system.
A ) Registered Devices means the MAC Address of a network interface on a Compatible Device in the name of the Customer registered (in a manner as ASK4 shall from time to time determine) to receive the Service and/or an Additional Service.
b) A device data register is a device register (a dedicated memory location in memorymapped I/O) that holds the data that is to be input/output. (c) A device status register is a device register (a dedicated memory location in memorymapped I/O) that indicates the status of the input/output.
(c) A device status register is a device register (a dedicated memory location in memorymapped I/O) that indicates the status of the input/output. It allows for the processor to know whether or not input/output of the value in the device data register has occurred.
What is the purpose of using status register?The status register lets an instruction take action contingent on the outcome of a previous instruction. Typically, flags in the status register are modified as effects of arithmetic and bit manipulation operations. For example, a Z bit may be set if the result of the operation is zero and cleared if it is nonzero.
To learn more about The status register, refer
https://brainly.com/question/24209220
#SPJ2
The science of networking is attributed to which government's involvement?
O China
0 Japan
O Germany
O the United States
Answer:
The United States
if I am not mistaken
When servers are configured so there is a seamless backup of data and the server, the servers are said to be
what?
Answer: they would be backed up to the cloud
Explanation: a seamless backup of data would mean that the data would be transfered somewhere else like the cloud
Does anyone have the answer for the project stem 6.4 code practice
Answer:
#This imports the simplegui module
import simplegui
#This defines the draw_handler function
def draw_handler(canvas):
#The next five lines draws the boundaries of the polygon, in white
canvas.draw_polygon([(300, 400), (550, 400), (550, 550), (300, 550)], 2, "White")
canvas.draw_polygon([(275, 400), (425, 300), (575, 400)], 2, "White")
canvas.draw_polygon([(400, 475), (400, 550), (450, 550), (450, 475)], 2, "White")
canvas.draw_polygon([(325, 450), (325, 500), (375, 500), (375, 450)], 4, "White")
canvas.draw_polygon([(525, 450), (525, 500), (475, 500), (475, 450)], 4, "White")
#The main method begins here
#This creates the frame of the polygon
frame = simplegui.create_frame('House', 600, 600)
#This sets the background as black
frame.set_canvas_background("Black")
#This calls the draw_handler method
frame.set_draw_handler(draw_handler)
#This starts the frame
frame.start()
Explanation:
works for question 1 and 2! your welcome
How does the technology affect you daily living? Give situations where you use technology and how it helped you.
Answer:
Technology affects the way individuals communicate, learn, and think. It helps society and determines how people interact with each other on a daily basis. Technology plays an important role in society today. It has positive and negative effects on the world and it impacts daily lives. We are living in an era where technological advances are common. The internet and cell phones are some examples. However, with technological advances, there’s a downside to it all.
4.(L.5.1.A) Select the sentence that includes an interjection,
Did we win the tournament?
ОО
Hurray, we won the tournament!
Although we arrived late to the tournament, we still won.
We arrived late to the tournament, but we still ended up winning
Answer:
Hurray, we won the tournament!
Explanation:
hurray is an interjection just like yikes, uh-oh, and others
Trong mạng internet, chúng tôi thay đổi công nghệ mạng LAN sang một công nghệ
mới. Những lớp nào trong bộ giao thức TCP / IP cần được thay đổi?
Answer
ké
Explanation:
Select the three concepts of capital outlay.
resources
Initial
Gift
Borrowed
Repaid
Small
Answer:
the three concepts of capital outlay are
resources
borrowed
repaid
IM GOING TO GO BANKRUPT
Answer:
get some insurance to fix your bankrupt problem
Explanation:
4. Suppose you replace the hard disk in the previous question with an optical drive like a DVD drive. The drive you use has an average access time of 185ms and can-do sustained reads at 1600 Kbytes per second. How long will it take, including access time, to read the same 750 Kbytes off this optical disk (again, assuming all the data is in sequential sectors on same track)
The total time it will take to read the same 750 Kbytes off the optical disk is 653.75 ms
Considering the parameters given in the question, the total time taken to read the same drive is the addition of the average access time together with the time to transfer the data.
Mathematically;
Total Time taken = Access time (avg.) + data transfer time
where;
access time(avg.) = 185 msthe data transfer time can be estimated by using the formula:
= required quantity of data transferred/ speed of data transfer
= 750 kbytes ÷ 1600 Kbytes/s
= 0.46875 s
= 468.75 ms
∴
Total Time taken = 185 ms + 468.75 ms
= 653.75 ms
Learn more about data transfer time here:
https://brainly.com/question/9381456?referrer=searchResults
27. The device name I dev/ hda3 refers to: a. the third partition on the first IDE hard disk b. the third partition on the first SCSI hard disk c. the third IDE hard disk d. the swap partition stored on a boot disk
c.the third IDE hard disk
Assume the size of an integer array is stored in $s0 and the address of the first element of the array in the memory is stored in $s1. Write a program to populate the array with Fibonacci numbers. The Fibonacci sequence begins with 0 and then 1, each following number is the sum of the previous two numbers. Ex: 0, 1, 1, 2, 3, 5, 8, 13. Assume the size of the array is always at least 1.Ex: If $s0 and $s1 are initialized in the simulator as 5 and 5000, the data memory starting at address 5000 will containAddresses Data5000 05004 15008 15012 25016 3
A program to populate the array with Fibonacci numbers. The Fibonacci sequence begins with 0 and then 1, each following number is the sum of the previous two numbers is given below
The Programpublic class Fibonacci
{
public static int fibonacci(int n)
{
if (n == 0)
return 0;
else if (n == 1)
return 1;
else
return fibonacci(n - 1) + fibonacci(n - 2);
}
public static void main(String[] args)
{
System.out.println(fibonacci(11));
}
}
We can also use recursion
// Fibonacci Series using Recursion
#include <bits/stdc++.h>
using namespace std;
int fib(int n)
{
if (n <= 1)
return n;
return fib(n - 1) + fib(n - 2);
}
int main()
{
int n = 9;
cout << fib(n);
getchar();
return 0;
}
The Output is 34.
The original recursion tree is:
fib(5)
/ \
fib(4) fib(3)
/ \ / \
fib(3) fib(2) fib(2) fib(1)
/ \ / \ / \
fib(2) fib(1) fib(1) fib(0) fib(1) fib(0)
/ \
fib(1) fib(0)
Read more about programming here:
https://brainly.com/question/23275071
#SPJ1
IBM’s system that is built on the middle ground approach to AI.
Answer:
IBM Watson is AI for business. Watson helps organizations predict future outcomes, automate complex processes, and optimize employees' time.
Explanation:
tên trong pascal gồm những thành phần nào?
Explanation:
Pascal phân biệt ba loại tên: + Tên dành riêng: là tên được ngôn ngữ lập trình quy định dung với ý nghĩa riêng xác định. người lập trình không được sử dụng với ý nghĩa khác. Ví dụ (Trong pascal): program, uses, const, type, var, begin, end.
How are most gamepads installed on devices?
Answer:
Plug and Play
Explanation:
most modern game pads are you just need to plug into a port and then you are free to use without any setting up.
Write a program to input two integer values and find out
whether the first or the second number is greater.
it is easy
there is photo ok
What is the stdio.h header file ?
computer that are joined together are called a network.\ true or false
Answer:
True
Explanation: