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
ioda
3 years ago
7

Examples of solar system​

Computers and Technology
1 answer:
Anon25 [30]3 years ago
3 0

Answer:

Earth

Mercury

Venus

Jupiter

Mars

Neptune

Saturn

Uranus

You might be interested in
(The Location class) Design a class named Location for locating a maximal value and its location in a two-dimensional array. The
-Dominant- [34]

Answer:

Here is the Location class:

public class Location {   //class name

   public int row;  // public data field to hold the value of no. of rows

   public int column;  // public data field to hold the value of no. of columns

   public double maxValue;   //public data field to hold the maximum value

   public Location(int row, int column, double maxValue) { //parameterized constructor of Location class

//this keyword is used to refer to a current instance variable and used to avoid naming conflicts between attributes and parameters with the same name

       this.row = row;  

       this.column = column;  

       this.maxValue = maxValue;     }  

   public static Location locateLargest(double[][] a) {   //method that takes a 2 dimensional array a as argument and returns the location of the largest element

       int row = 0;  //initializes row to 0

       int column = 0;  //initializes column to 0

       double maxValue = a[row][column];   //stores largest element

       for (int i = 0; i < a.length; i++) {  //iterates through rows of a[] array

           for (int j = 0; j < a[i].length; j++) {  //iterates through columns of array

               if (maxValue < a[i][j]) {  //if the maxValue is less than the element of 2 dimensional array at ith row and jth column

                   maxValue = a[i][j];  //then set that element to maxValue

                   row = i;  // i is set to traverse through rows

                   column = j;   }             }         }  // i is set to move through columns

       return new Location(row,column,maxValue);     }  } //calls constructor of class by passing row, column and maxValue as argument

Explanation:

Here is the Main class with a main() function to  test program  

import java.util.Scanner;   //to accept input from user

public class Main {   //class name

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

       Scanner scan = new Scanner(System.in);  //creates Scanner class object to scan the input from user

 System.out.print("Enter the number of rows and columns in the array: ");  //prompt for user

       int row = scan.nextInt();  // reads value of row from user

       int column = scan.nextInt();  //reads input value of column

       double[][] array = new double[row][column];   //declares a 2 dimensional array named array

       System.out.println("Enter the array:");  //prompts to enter array elements

       for (int i = 0; i < array.length; i++) {  //iterates through the rows of array until the size of array is reaced

           for (int j = 0; j < array[i].length; j++) {  //iterates through the columns of array

               array[i][j] = scan.nextDouble();    }    }   //reads each element at i-th row and j-th column

       Location location = Location.locateLargest(array);  //calls locateLargest method by passing array to it in order to locate the largest element in the array

System.out.println("The largest element in a two-dimensional array is: " + location.maxValue);  //displays the largest element of array

       System.out.println("The location of the largest element is at (" + location.row + ", " + location.column + ")");       }    } //displays the location of the largest element in the two dimensional array

Suppose the user enters 2 rows and 2 columns. The elements are:

1         5.5

4.5      3

The program works as follows:

for (int i = 0; i < array.length; i++) this outer loop iterates through rows

i = 0

inner loop for (int j = 0; j < array[i].length; j++) iterates through columns

array[i][j] = scan.nextDouble(); reads the element at position i-th row and j-th column. This becomes:

array[0][0] = scan.nextDouble();

so element at 0th row and 0th column is 1

Location location = Location.locateLargest(array); now this calls the method which works as follows:

double maxValue = a[row][column]; this becomes:

double maxValue = a[0][0];

so maxValue = 1

for (int i = 0; i < a.length; i++) this loop in method iterates through rows and  for (int j = 0; j < a[i].length; j++) this iterates through columns of array

if (maxValue < a[i][j]) this becomes:

if (maxValue < a[0][0])

As we know that maxValue = 1 so this if condition is true.

                   maxValue = a[i][j];  this becomes:

             maxValue = a[0][0];  

maxValue = 1

Now set row = 0 and column = 0

Now the inner loop value of j is incremented to 1. So j = 1

At next iteration array[0][1] is checked. The element at this position is 5.5

if (maxValue < a[i][j]) is true because 1<5.5 so now value of maxValue becomes:

maxValue = 5.5

and

i = 0  j = 1

This way at each iteration of inner loop the columns are traversed and at each iteration of outer loop rows are traversed.

At next iteration element at array[1][0] is checked which is 4.5. This is not greater than maxValue so maxValue remains 5.5

At next iteration element at array[1][1] is checked which is 3. This is not greater than maxValue so maxValue remains 5.5 .

After both the loops end the statement:

return new Location(row,column,maxValue);

returns row , column and maxValue

where row = 0  column = 1 and maxValue = 5.5

So the output is:

The largest element in a two-dimensional array is: 5.5

The location of the largest element is at (0,1)

3 0
4 years ago
Design aPayrollclass that has fields for an employee’sname, ID number, hourly pay rate,and number of hours worked. Write theappr
wariber [46]

Answer:

public class Payroll {

   private String employeeName;

   private int employeeId;

   private double ratePerHour;

   private double totalWorkHours;

   public Payroll(String employeeName, int employeeId) {

       this.employeeName = employeeName;

       this.employeeId = employeeId;

   }

   public String getemployeeName() {

       return employeeName;

   }

   public voemployeeId setemployeeName(String employeeName) {

       this.employeeName = employeeName;

   }

   public int getemployeeId() {

       return employeeId;

   }

   public voemployeeId setemployeeId(int employeeId) {

       this.employeeId = employeeId;

   }

   public double getratePerHour() {

       return ratePerHour;

   }

   public voemployeeId setratePerHour(double ratePerHour) {

       this.ratePerHour = ratePerHour;

   }

   public double gettotalWorkHours() {

       return totalWorkHours;

   }

   public voemployeeId settotalWorkHours(double totalWorkHours) {

       this.totalWorkHours = totalWorkHours;

   }

   public double getGrossPay() {

       return ratePerHour * totalWorkHours;

   }

}

import java.util.Scanner;

public class PayrollTest {

   public static voemployeeId main(String[] args) {

       Scanner in = new Scanner(System.in);

       String employeeName;

       int employeeId;

       System.out.print("Enter employee's Name: ");

       employeeName = in.next();

       System.out.print("Enter employee's Id: ");

       employeeId = in.nextInt();

       Payroll payroll = new Payroll(employeeName, employeeId);

       System.out.print("Enter employee's hourly rate: ");

       payroll.setratePerHour(in.nextDouble());

       System.out.print("Enter employee's total hours worked:  ");

       payroll.settotalWorkHours(in.nextDouble());

       System.out.println("Gross pay = " + payroll.getGrossPay());

   }

}

Explanation:

  • Inside the Payroll class, initialize variables for employee name, ID number, hourly pay rate, and number of hours worked.
  • Define the getter and setter methods for the necessary variables inside the Payroll class.
  • Inside the main method, create an object of the Payroll class.
  • Get all the employee information as an input from user.
  • Call the getter function of  the class and display the gross pay of employee.

5 0
4 years ago
Help<br><br> My internet won't work on my other pc i tried a lot to get it back
sladkih [1.3K]

Have you tried restarting your internet yet? I'm not very skilled with stuff like this, but my dad sometimes does that if nothing else is working.

Hope you can figure it out!

7 0
3 years ago
Read 2 more answers
Write a public static method called getPIDs that has a parameter of type Map called nameToPID (keys are student names and values
Rasek [7]

Answer:

Java program is explained below

Explanation:

import java.util.HashSet;

import java.util.Map;

import java.util.TreeMap;

public class TruckRace1 {

   public static HashSet<String> getPIDs (Map<String,String>nameToPID ){

       HashSet<String> pidSet = new HashSet<>();

       for(String ids: nameToPID.values()){

           pidSet.add(ids);

       }

       return pidSet;

   }

   public static void main(String[] args) {

       Map<String,String> pids = new TreeMap<>();

       pids.put("John","123");

       pids.put("Jason","124");

       pids.put("Peter","125");

       pids.put("Alice","126");

       pids.put("Peny","129");

       HashSet<String> ids = getPIDs(pids);

       for(String id:ids){

           System.out.println(id);

       }

   }

}

4 0
3 years ago
How can you create balance to your drawing using only grayscale values?
Leokris [45]

use only fine pencils  

5 0
4 years ago
Other questions:
  • What can you search on Microsoft Word or Powerpoint Clipart or Google (Clip art) to find more pictures like the ones below but w
    7·1 answer
  • Write a program which reads in a single integer 0 &lt;= n &lt; 30 and prints out the factorial of n. Factorials get very big ver
    9·2 answers
  • Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,
    7·1 answer
  • A client has an issue with large files taking a long time to open or save. As time goes by, the issue worsens. The client has hu
    8·1 answer
  • A switch is closed, and a lamp turns on.The switch is opened, the lamp turns off. eXplain what is meant by these two statements.
    10·1 answer
  • An IT company revises its process parameters in response to complaints from vendors that products were not ready on time. This w
    15·1 answer
  • PLEASE HELP me with at least 1 of the problems in the picture <br><br>We are coding using python​
    14·1 answer
  • Write a program to play an automated game of Rock, Paper, Scissors. Two players make one of three hand signals at the same time.
    9·1 answer
  • Which protocol makes a connection, checks whether the data is received, and resends it if it is not?
    12·1 answer
  • when you arrived at the unit today and listened to the change of shift report, you heard about a patient named jane w. according
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!