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
PilotLPTM [1.2K]
2 years ago
14

Create a class 'ProblemSolution' with following characteristics A public method 'solution' without parameters and return type is

int. Create object of class 'Student' inside 'solution' method and return the value of ""rollNumber"" from the class 'Student'.
Computers and Technology
1 answer:
Rus_ich [418]2 years ago
8 0

Answer:

The program to this question as follows:

Program:

class Student //defining class student

{

int rollNumber=1001; //defining integer variable rollnumber and assign value

int value() //defining method value

{

return rollNumber; //return value

}

}

public class ProblemSolution extends Student //defining class problemSolution that inherits Student

{

int solution() //defining method solution

{

Student stu=new Student(); //creating student class object

return stu.value(); //call function using return keyword  

}

public static void main(String ax[]) //defining main method

{

int result; //defining integer variable result

ProblemSolution ps=new ProblemSolution(); //creating class object

result=ps.solution(); //holding value of solution function

System.out.println("rollNumber value is: "+result); //print value

}

}

Output:

rollNumber value is: 1001

Explanation:

In the above java code two-class "Student and ProblemSolution" is defined, in which student class an integer variable rollNumber is defined, that holds a value "1001", and inside this class, a method "value" is defined, that return above variable value.

  • In the next step, class "ProblemSolution" is defined, that inherits the student class, inside this class two method "solution and the main method" is defined.
  • Inside the solution method, the student class object is created and this method uses the return keyword to call the student class method "value".
  • In the main method, an integer variable "result" is defined, which holds its method "solution" value and uses print function to print its value.
You might be interested in
The following checksum formula is widely used by banks and credit card companies to validate legal account numbers: d0 + f(d1) +
Aleksandr [31]

Answer:

Here is the JAVA program:

import java.util.Scanner; //to import Scanner class

public class ISBN

{   public static void main(String[] args)  { // start of main() function body

   Scanner s = new Scanner(System.in); // creates Scanner object

//prompts the user to enter 10 digit integer

   System.out.println("Enter the digits of an ISBN as integer: ");    

   String number = s.next(); // reads the number from the user

   int sum = 0; // stores the sum of the digits

   for (int i = 2; i <= number.length(); i++) {

//loop starts and continues till the end of the number is reached by i

          sum += (i * number.charAt(i - 1) ); }

/*this statement multiplies each digit of the number with i and adds the value of sum to the product result and stores in the sum variable*/

          int remainder = (sum % 11);  // take mod of sum by 11 to get checksum  

   if (remainder == 10)

/*if remainder is equal to 10 adds X at the end of given isbn number as checksum value */

  { System.out.println("The ISBN number is " + number + "X"); }

  else

// displays input number with the checksum value computed

 {System.out.println("The ISBN number is " + number + remainder); }  }  }  

Explanation:

This program takes a 10-digit integer as a command line argument and uses Scanner class to accept input from the user.

The for loop has a variable i that starts from 2 and the loop terminates when the value of i exceeds 10 and this loop multiplies each digit of the input number with the i and this product is added and stored in variable sum. charAt() function is used to return a char value at i-1.

This is done in the following way: suppose d represents each digit:

sum=d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5 + d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9

Next the mod operator is used to get the remainder by dividing the value of sum with 11 in order to find the checksum and stores the result in remainder variable.

If the value of remainder is equal to 10 then use X for 10 and the output will be the 10 digits and the 11th digit checksum (last digit) is X.

If the value of remainder is not equal to 10, then it prints a valid 11-digit number with the given integer as its first 10 digits and the checksum computed by sum % 11 as the last digit.  

8 0
2 years ago
_______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
Sergeu [11.5K]

Answer:

Rootkit.

Explanation:

Rootkit is a collection of software tools,mostly malicious.These are mostly used by hackers to obtain administrator permission to a computer by masking intrusion.

Root-kit is made from two word Root and kit.Where root refers to the name of privileged account on an operating system that is somewhat like unix and KIT refers to the tools used.

6 0
3 years ago
Meaning of mesh topology​
Pachacha [2.7K]

The meaning of mesh topology​ is that it is a type of networking that is made up of the fact that all its nodes do work together to share data amongst each other.

<h3>What is meant by mesh topology?</h3>

Mesh topology is a kind of networking that is said to be where the full nodes do act in a form of a cooperation  so that they can be able to share or distribute data among themselves.

Note that this topology was said to be first seen or developed in about an approximate of about 30+ years ago and it is one that is often used in military applications and now it is seen to be used in home automation, smart HVAC control, and others.

Hence, The meaning of mesh topology​ is that it is a type of networking that is made up of the fact that all its nodes do work together to share data amongst each other.

Learn more about mesh topology​ from

brainly.com/question/14879489

#SPJ1

6 0
1 year ago
Which tools allows you to see the edition, version and memory use by windows 10?
cricket20 [7]

Answer:

Resource Monitor

Performance Monitor

Computer Management and Administrative Tools

Advanced User Accounts Tool

Disk Cleanup

Local Group Policy Editor

There is alot do u want them all?

6 0
3 years ago
Why should we be concerned about HVAC systems when discussing security?
lana66690 [7]

Answer:

 HVAC is stand for the heating, ventilation and the air conditioning system that basically perform various type computer management and operation system. It also helps to improve the productivity of the system.

 As, HVAC system is very concerned about the security as it basically include various types of toxic chemical in the environment that include various types of criminal and terrorist activities and natural disaster.

The HVAC systems are easily cause various accidental cases due to its complexity nature. It also performing various types of function in the management sector like maintenance, system updating function an remote controlling maintenance.

4 0
3 years ago
Other questions:
  • Identify requirements that should be considered when determining the locations and features of firewalls. What are some importan
    5·1 answer
  • In what country did true printing first take place?
    12·2 answers
  • Okay so I know this is a platform for assignments but I really need a tech expert... So I had a 16 GB SD card and because of eve
    14·1 answer
  • Create a file account.cpp containing a Bank Account Class.
    11·1 answer
  • What is the definition of digital literacy?
    7·2 answers
  • How do i find the greatest common factor of two numbers?
    14·1 answer
  • I will give brainliest!!!
    13·1 answer
  • What feature is available to add a auggestion in the margin of someone else's document.
    11·1 answer
  • Identify a statement that accurately differentiates between short-term memory and working memory.
    15·1 answer
  • A____consists of many users and their information.​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!