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
"Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen
m_a_m_a [10]

Answer:

#include <iostream>  // includes input output functions

#include <string> // used for string functions

using namespace std;   // identifies objects like cout , cin

int main() {  // body of the main function

int index;   // index position of the elements

simonPattern = "RRGBRYYBGY";   //stores simon pattern

userPattern = "RRGBBRYBGY";   //stores user pattern

int userScore = 0;  // used to store the user score

// loop compares characters of user and simon patterns

for ( index = 0; userPattern[index] == simonPattern[index]; ++index) {

     userScore = userScore +1; // adds to the user score

     if (userPattern[index] != simonPattern[index]){

//if user and simon pattern do not match

        break;      }   } // breaks the loop

cout << "userScore is  " << userScore; // prints the user score

Explanation:

The program compares the user pattern to simon pattern character by character and keeps adding one to the user score if the characters of both simon and user patterns match. The loop breaks if the character of user pattern does not match with that of simon matter. At the end the calculated user score is displayed in the output.

3 0
3 years ago
Write JavaScript code to declare a variable of the name favoriteColor
Zinaida [17]

Answer:

Variables are used to store values (name = "John") or expressions (sum = x + y).

Declare Variables in JavaScript

Before using a variable, you first need to declare it. You have to use the keyword var to declare a variable like this:

var name;

Assign a Value to the Variable

You can assign a value to the variable either while declaring the variable or after declaring the variable.

var name = "John";

OR

var name;

name = "John";

Explanation:

thats what i found sorry if it wrong

:D

8 0
3 years ago
One limitation of high-level programming languages is
faltersainse [42]

Answer:

One limitation of high-level programming languages is It takes additional translation times to translate the source to machine code

<em>High level programs are comparatively slower than low level programs. Compared to low level programs, they are generally less memory efficient. Cannot communicate directly with the hardware.</em>

4 0
3 years ago
Use the ________ property in the html link tag to to associate a web page with a style sheet for printing.
lawyer [7]
You should use the <span>media="print" link tag to achieve this. </span>
8 0
3 years ago
What does the -pwd switch do? how can you make dsadd bring up a prompt asking for the users password?
Leno4ka [110]
Greeting's!

It Will Ask You To Input An Old Password "Current" Password And A "New" Password After That Is Done You Can Use The "New" Password Instead Of The "Old" Password.
3 0
3 years ago
Other questions:
  • You just read an msds for acetic acid. based on what you read, what type of information is included in an msds sheet? record you
    7·1 answer
  • What is the input output ratio if its 12/23
    7·1 answer
  • Who is the last person appointed to the u.s supreme court
    11·1 answer
  • What do the letters of the su command stand for? what can you do with su besides give yourself root privileges? "what can you do
    5·1 answer
  • Convert to octal. Convert to hexadecimal. Then convert both of your answers todecimal, and verify that they are the same.(a) 111
    12·1 answer
  • What option is used to combine several objects so that they can be treated as a single unit
    6·1 answer
  • What is a good way to minimize technical problems with your computer
    10·1 answer
  • The software used to help run the computer hardware is the _____.
    9·2 answers
  • Which of the following statements are true regarding models? Select 3 options.
    11·1 answer
  • ________ technologies are technologies that enable the incremental improvement of products and services.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!