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
Anvisha [2.4K]
4 years ago
7

Write a for loop that displays your name and student number 12 times.

Computers and Technology
1 answer:
d1i1m1o1n [39]4 years ago
5 0

Answer:

// here is code in java.

import java.util.*;

// class definition

class Solution

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // scanner object

       Scanner s=new Scanner(System.in);

        // variables

      String s_name;

      int s_num;

      System.out.print("Please enter the name:");

       // read the student name

      s_name=s.nextLine();

      System.out.print("Please enter the number:");

       // read the student number

      s_num=s.nextInt();

       // print name and number 12 times

      for(int i=0;i<12;i++)

      {

          System.out.println(s_name+"----"+s_num);

      }

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create a scanner class object to read input from user.Read the student name and the number from user and assign them to variable "s_name" and "s_num".Print the student name and number 12 times with the help of for loop.

Output:

Please enter the name:Mary Kaur

Please enter the number:123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

Mary Kaur----123456

You might be interested in
Write a program that will calculate the following function:
anyanavicka [17]
Shshshshshshsjsjsjsjjsjdhdhhddhhd
8 0
3 years ago
Which very high-speed fiber network was already in place and being used for wide area networking (wan) transmissions, before the
Stolb23 [73]

The high-speed fiber network that is already in place and being used for wide area networking (wan) transmissions, before the IEEE developed the 10gbe ethernet standards is called SONET.

<h3>What does SONET stand for in networking?</h3>

SONET  is known to be a term that is called Synchronous Optical Network.

This is said to be defined as a standard  that is known to be used in linking or in the act of connecting fiber-optic transmission systems and it is one that is sold in North America only.

Therefore, The high-speed fiber network that is already in place and being used for wide area networking (wan) transmissions, before the IEEE developed the 10gbe ethernet standards is called SONET.

Learn more about fiber network from

brainly.com/question/26259562
#SPJ1

8 0
2 years ago
I need answer pooooooo​
lara [203]
Read the instructions right, youll get ir done
7 0
3 years ago
George has to present the goals of information management to his team member. What is a goal of information management? The goal
Law Incorporation [45]

Answer:

The purpose of information management is to: design, develop, manage, and use information with insight and innovation. support decision making and create value for individuals, organizations, communities, and societies.

Explanation:

5 0
3 years ago
Why do we need to shutdown our computer unit before we clean and disassemble?
Len [333]
Silly question! Of course you have to shutdown because you can ruin some components. Also you can block the CPU fan, CPU is very hot like the computer internals.
3 0
4 years ago
Other questions:
  • You are setting up a desktop computer for an AutoCAD specialist who needs a minimum of 125GB of RAM. Which operating system belo
    6·1 answer
  • Why does everyone refer to dogs as being loyal
    11·2 answers
  • Not sure where I should ask this sorry
    15·1 answer
  • Why is failure important when you are designing a solution to a problem?
    6·2 answers
  • What in the world is this for and how do you use it
    8·2 answers
  • You want to add a picture of a potential new office layout to the title page of a proposal. How can you adjust the size of the i
    14·1 answer
  • "queries are questions", true or false?
    8·2 answers
  • Write a program that will add up the series of numbers: 99, 98, 97… 3, 2, 1. The program should print the running total as well
    13·1 answer
  • ____ is a technology that exists inside another device
    9·2 answers
  • A _____ is a grid that displays fields as columns and records as rows.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!