![senituliii](/avatars/32455.jpg)
senituliii
01.08.2019 •
Computers and Technology
A(n) specifies a variable's name and data type.
Solved
Show answers
More tips
- C Computers and Internet How to Teach Older Generations to Work with Computers?...
- L Leisure and Entertainment Unlocking the Secrets of Fast and Effective Tectonic Learning...
- S Style and Beauty How to Choose the Perfect Hair Color?...
- C Computers and Internet Best iPad Games: Our Opinion...
- A Animals and plants Man s Best Friend: Which Dog Breed Is the Most Friendly?...
- H Health and Medicine 10 Simple Techniques on How to Boost Your Mood...
- G Goods and services How to Choose the Right High Chair for Your Baby?...
- S Style and Beauty Learn how to tie a keffiyeh on your head like a pro...
- S Style and Beauty How to braid friendship bracelets?...
Answers on questions: Computers and Technology
- M Mathematics If the rectangular surface of the prism is 720cm sq with perimeter 20cm , find its height i need your help guys...
- H History A harsh drought killed some of the farm family’s corn and several of its cattle. Where on the production possibilities curve could you position a point to reflect theses circumstances...
- B Biology Mrs. olson was diagnosed as having a malignancy characterized by a progressive increase of abnormal leukocytes. this type of cancer is known as...
Ответ:
I say function to because it perfectly fits in the blank spot
Ответ:
This question is not complete, here's the complete question:
The program is run using the following command:
java programName #row #cols < students.txt
#rows and #cols are integers indicating the number of rows and columns of seats in the
classroom. students.txt is a text file holding the student names.
a) (5 points) Write a code-segment to:
1. Declare a 1-D String array variable, studentLine, that has space to hold all
students in the class in a single line. (Figures 1 and 3)
2. Declare a 2-D String array variable, room, to represent the seats in the classroom
where the number of rows and number of columns are given as command line input.
Explanation:
a) 1 -> String[] studentLine = new String[Integer.parseInt(args[0]) * Integer.parseInt(args[1])];
2 -> String[][] room = new String[Integer.parseInt(args[0])][ Integer.parseInt(args[1])];
b)
public static void fillLine(String[] a){ try { File f=new File("students.txt"); FileReader fr=new FileReader(f); BufferedReader br=new BufferedReader(fr); String l; int index = 0; while((l = br.readLine())!=null) { a[index] = l; index++; } fr.close(); } catch(IOException e) { e.printStackTrace(); } }