1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tasya [4]
3 years ago
13

Insert the missing code in the following code fragment. This fragment is intended to read an input file named dataIn.txt and wri

te to an output file named dataOut.txt.
public static void main (String[] args) throws FileNotFoundException
{
String inputFileName = "dataIn.txt";
String outputFileName = "dataOut.txt";
File inputFile = new File(inputFileName);
Scanner in = ________;
...
}
Computers and Technology
1 answer:
olasank [31]3 years ago
6 0

Answer:

new Scanner(inputFile)

Explanation:

In Java when inputting a file using Scanner class. A Scanner breaks the input into tokens with the help of delimiting patterns, by default which matches the whitespaces and then the tokens that are received may be converted into values of different types by suing different next methods.

You might be interested in
Which writing format is also beneficial to public speaking? a. Five paragraph essay c. Conventions b. Prose d. None of these
garri49 [273]
convention writing is beneficial to public speaking because writing conventions such as spelling,punctuation,capitalization and grammar help make a student content clear and understandable audience can finish reading without having to stop to try to figure out what was actually intended,the value of learning these writing becomes clear.<span />
4 0
3 years ago
Read 2 more answers
3.17 (LAB) Ch 5 Warm up: Drawing a right triangle (Python 3) This program will output a right triangle based on user specified h
andre [41]

Answer:

Find answers below

Explanation:

triangle_char = input('Enter a character: ')

triangle_height = int(input('Enter triangle height: '))

print('')

for j in range (triangle_height):

   print((triangle_char) * (j + 1))

#below are sample output that can be gotten with predefined values

$ ./triangles.py  

Enter characters: jk

Enter height: 8

j

jj

jjj

jjjj

jjjjj

jjjjjj

jjjjjjj

jjjjjjjj

k

kk

kkk

kkkk

kkkkk

kkkkkk

kkkkkkk

kkkkkkkk

3 0
3 years ago
50 Points! 25 Points Each! Please help ASAP! Will mark brainliest! See attached image.
monitta

Answer:

I can't see the image

Explanation:

please put image up there

6 0
3 years ago
Read 2 more answers
Cheri needs to write a small program that interacts with the user. What step will allow her to do this?
Alinara [238K]

Answer:

Including a input statement

Explanation:

You need a input statement in order for it to work, here´s an example;

script.parent.click <u>then</u>

you need the ¨.mouse¨ after parent or it wouldnt work.

8 0
3 years ago
Read 2 more answers
Assuming a computer has a single processor and a single core with no support for parallel execution, explain why running a multi
IRISSAK [1]

Answer:

Explanation:

Before we go deep into this question lets have some brief knowledge on parallel execution, parallel processing and multi tasking.

Parallel Execution : in this two or more tasks or program can be executed parallel or simultaneously.

For example if there are two processors and four programs to be executed then it executes two at a time.

Multi tasking: in this two or more tasks can be performed simultaneously switching between them without exiting any application.

For example we use notepad, word pad, excel sheet, chrome all at a time switching between each other.

Multi Threading: It is splitting up the program into different threads.If the contents in the program are independent on each other then the program can be split into multi threads and can be processed.

Multi threading in multi core or processing unit : In this threads are executed parallel or simultaneously in different processes.

For example if there are two processors then one multi threaded program can execute two threads in two different processors.

Multi threaded program in single core unit : In this, program is multi threaded where as threads cannot execute parallel or simultaneously. they sholud be executed by the same processor. So they should wait in queue

Ex: consider three tasks of 6 secs each and multi threaded each into three threads of two seconds.

Task1 3secs > task2 3secs > task3 3 secs it repeats until each task is completed

Total time taken is 3+3+3+3+3+3+3+3+3 is 18seconds...

If they are executed one by one without multi threading total execution time has no change..

Where as multi threading program has its advantages if different threads are executed at different place..

If one thread executes at network, another at printer and other processor then these three can execute at same time at different processors. Multi threading has its advantages but in single core systems it doesn't affect the performance.

Inter process communication consists of

Information Sharing, message passing, Modularity.

In shared memory inter process communication processes shares the memory between each other.

In message passing communication process communicates like request and replies for information and resources.

Interlocking is due to error in resource sharing and information sharing. It results in system collapse.

Al these process communication is required if there are two or more.processes but in single core it is not much useful and advisable.

In single core there will be a single processor, processing multi threaded program as it can access all the memory contents there will be no problem of process communication. Where as in multi core systems different processes may compete for same memory or resource.

In single core systems inter process communication makes things complex and these complexity is not much useful in any of the improvement in performance.

4 0
4 years ago
Other questions:
  • Before using the data type string, the program must include the header file ____.
    6·1 answer
  • Smoking is a REALLY good example of a choice that can have negative effects on the smoker's health, AND the well-being of others
    9·1 answer
  • The CPU package is installed using the ____ process
    7·1 answer
  • To print data sideways on a piece of paper, use the _______ page orientation setting.
    6·2 answers
  • Can a spreadsheet be filtered only by one column at a time?
    11·1 answer
  • You are part of a team that is setting up a movie streaming service. The company is planning on initially making available 500 m
    8·1 answer
  • The correct ordering of the seven layers from "top" to "bottom" is
    11·1 answer
  • What are the different nail disorders?
    13·1 answer
  • __________ contain(s) remnants of word processing documents, e-mails, Internet browsing activity, database entries, and almost a
    9·1 answer
  • Que es una red de datos
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!