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
shutvik [7]
2 years ago
14

Write a method called classAttendence() that creates a 10-by-10 two-dimensional array and asks for user input to populate it wit

h strings of student names. The method should not return any values.
Computers and Technology
1 answer:
gladu [14]2 years ago
6 0

Answer:

The method written in Java is as follows:

public static void classAttendance(){

   Scanner input = new Scanner(System.in);

   String[][] names = new String[10][10];

   for(int i =0;i<10;i++){

    for(int j =0;j<10;j++){

       System.out.print("Student Name: "+(i+1)+" , "+(j+1)+": ");

       names[i][j] = input.nextLine();        

    }  

   }

}

Explanation:

This defines the classAttendance() method

public static void classAttendance(){

   Scanner input = new Scanner(System.in);

This declares the 2D array of 10 by 10 dimension as string

   String[][] names = new String[10][10];

This iterates through the rows of the array

   for(int i =0;i<10;i++){

This iterates through the columns of the array

    for(int j =0;j<10;j++){

This prompts user for student name

       System.out.print("Student Name: "+(i+1)+" , "+(j+1)+": ");

This gets the student name from the user

       names[i][j] = input.nextLine();        

    }  

   }

The method ends here

}

<em>See attachment for complete program that include main method</em>

Download txt
You might be interested in
Which best describes the benefits of renting a home? ARenting can cost more upfront. BRenting is less flexible than owning a hom
yulyashka [42]

Renting can be an alternative to many people, especially those in areas where house prices are very expensive. The benefits to renting a home, however, are not mentioned in the given question, making the best answer (D) none of the above.

Some actual benefits that a person can gain are actually flexibility, since renting means that you can easily move from one place to another compared to buying a home, where you require capital and selling the previous home also falls into your responsibility, while rentals are managed by landlords.

8 0
3 years ago
What is the difference between HTML and CSS? * 1. CSS is a markup language unlike HTML. 2. HTML is a backend technology and CSS
GarryVolchara [31]
The anserw is the third one. 
5 0
3 years ago
Read 2 more answers
The set of instructions that tell the computer what to do are called ____.
CaHeK987 [17]
Hi,

The word you are looking for is "programs".

Hope this helps.
r3t40
4 0
3 years ago
Read 2 more answers
Which of these is unused normal, unvisited link ??
Tomtit [17]

Answer:

hover

Explanation:

hope my answer help you

8 0
3 years ago
Which view shows how the document will look when printed?
DIA [1.3K]
Please provide photos for your question.
7 0
3 years ago
Other questions:
  • Although the battery on your smartphone is fully charged, it drains quickly. In some instances when the phone shows that the bat
    12·1 answer
  • Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer pr
    15·1 answer
  • Consider a multidimensional array A stored in row-major order with 22 rows and 6 columns whose subscripts start at 0. If each el
    8·1 answer
  • Businesses and sometimes individuals use a _____ to assimilate all of their social media content on a specific topic to engage r
    13·1 answer
  • in java Write a program with total change amount in pennies as an integer input, and output the change using the fewest coins, o
    13·1 answer
  • Any material that comes into contact with the body must be __________.
    6·1 answer
  • Think about the five steps to writing an algorithm. Why is each step necessary?
    6·2 answers
  • You were recently hired by a small start-up company. The company is in a small office and has several remote employees. You have
    15·1 answer
  • Can you guys help me with this coding assignments?
    10·1 answer
  • Define two benefits to members of the community of replacing the printed copy with an online version.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!