answer.
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
MArishka [77]
2 years ago
5

Assign courseStudent's name with Smith, age with 20, and ID with 9999. Use the printAll() member method and a separate println()

statement to output courseStudents's data. Sample output from the given program:
Computers and Technology
1 answer:
vekshin12 years ago
4 0

Answer:

Following are the program in the java language  

public class Main // Main class  

{

   String courseStudentsname; // variable declaration  

   int age; // variable declaration  

   int ID; // variable declaration  

   Main() // default constructor

   {

courseStudentsname="Smith";//assign the values mention in the question              

       age=20;//assign the values which is mention in the question  

       ID=9999;//assign the values which is mention in the question    

   }

void printAll() // method definition of printAll()  

   {

      System.out.print("Name: " + courseStudentsname ); // display name

      System.out.print(", Age: " + age); // display age

      System.out.print(", ID: " + ID); // display id

   }

public static void main(String[] args) // main fuunction()

{

Main ob=new Main(); // create the object of Main class  

ob.printAll(); // calling the method printAll()

}

}

Output:

Name:"Smith, Age:20, ID:9999

Explanation:

Following are the description of program

  • Create a constructor of "Main" class and store the respective values of courseStudentsname,age and ID in that constructor .
  • create a method printAll() and print the respective values in the given format which is mention in the question by using   System.out.print method.
  • In the main function create an object of "Main" class i.e "ob".
  • Finally, call the printAll() method by using the object of Main class.

You might be interested in
Which sentence describes a task on which a genetic engineer is most likely to work?
galina1969 [7]

Answer:

C

Explanation:

If you look at the picture, you will see why it is C. It says D, but the multiple choices are differently ordered and it is kind of differently worded.

But in conclusion, the answer is C.

5 0
2 years ago
Read 2 more answers
Suppose that you created an robot that was so advanced it could act independently in very complex situations. It made its own de
Mashutka [201]
It should not be capable of free action because there's no telling if it would be friendly for good remarks or mean for rude remarks
8 0
2 years ago
9. A __________ gateway sets up two TCP connections, one between itself and a TCP user on an inner host and one between itself a
aev [14]

Answer:

Stateful inspection

Explanation:

Stateful inspection: This is also known as dynamic packet filtering, it is a type firewall technology that monitors the state of active connections and uses this information to determine which network packets will be allowed through the firewall.

3 0
2 years ago
Read 2 more answers
In the lab, you used the filter box in Wireshark to remove traffic from port 3389. What is that port used for? What filter synta
Dmitry_Shevchenko [17]

Answer:

Port 3389 is used for remote desktop access to graphical interfaces.

The syntax used to track ping traffic is " tcp.port eq 25 or icmp".

Explanation:

Wireshark is a network packet sniffer tool used to analysing and troubleshooting packet transmission in a network.

The ping command is used in a network to check or confirm connectivity between two devices in the network. It sends ICMP message echos to the specified IP address and receives it back if there is connection. To get the ping traffic in wireshark the command syntax " tcp.port eq 25 or icmp" is used.

The port 3389 is a TCP and UDP listening port for the Microsoft proprietary protocol called remote desktop protocol or connection used to remotely connect to the graphical interface of other system running the RDP server.

6 0
2 years ago
A function defined beginning with void SetNegativesToZeros(int userValues[], ... should modify userValues such that any negative
Stels [109]

Answer:

   public static void setNegativesToZero(int userValues[]){

       System.out.println("Array before setting negatives to zero "+Arrays.toString(userValues));

       for(int i=0; i<userValues.length; i++){

           if(userValues[i]< 1){

               userValues[i] = 0;

           }

       }

       System.out.println();

       System.out.println("Array After setting negatives to zero "+Arrays.toString(userValues));

   }

Explanation:

Using Java programming Language, the method is created to receive an array of ints as parameter (as specified in the question)

Using a for loop, we iterate over the entire array checking for values that are negative (<0) and setting them to zero.

See a complete program below

import java.util.Arrays;

import java.util.Scanner;

public class num1 {

   public static void main(String[] args) {

   // Create an array and assign values

       int [] arr = {1,2,3,-1,1,2,-4};

   //Calling the method setNegativesToZero

   setNegativesToZero(arr);

   }

//Creating the Method

   public static void setNegativesToZero(int userValues[]){

       System.out.println("Array before setting negatives to zero "+Arrays.toString(userValues));

       for(int i=0; i<userValues.length; i++){

           if(userValues[i]< 1){

               userValues[i] = 0;

           }

       }

       System.out.println();

       System.out.println("Array After setting negatives to zero "+Arrays.toString(userValues));

   }

}

3 0
2 years ago
Other questions:
  • A telephone-repair technician uses a meter to measure voltage on a phone line. This meter is an example of _____. hardware softw
    10·2 answers
  • 14. If B3=10 and D5=8, what would the following function return? IF(B3&gt;D5, "Closed", D5-B3) *
    9·1 answer
  • Darcy is creating an instructional manual for her employees. She entered the text in a word processing program and wants to impo
    6·1 answer
  • You are a technical consultant for many businesses in your community. One of your clients, a small law firm, has a single Active
    14·1 answer
  • Juan, a network user, sends an email to you, the IT admin of the network, stating that his account is locked because he has lost
    14·1 answer
  • In this assignment, you are provided with working code that does the following: 1. You input a sentence (containing no more than
    14·1 answer
  • What types of messages flow across an SDN controller’s northbound and southbound APIs? Who is the recipient of these messages se
    15·1 answer
  • How to code 2.9.5: Four colored triangles {Code HS}
    10·1 answer
  • Seneca has just applied conditional formatting and realizes that she has made a mistake. Which action should she take to fix the
    12·2 answers
  • OH GOD PLEASE HELP I CAN'T FIGURE THIS OUT-
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!