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
babymother [125]
3 years ago
13

4.1 code practice python

Computers and Technology
1 answer:
omeli [17]3 years ago
3 0

Answer:

                                                                                   

Explanation:

You might be interested in
import java.util.Scanner; public class StudentScores { public static void main (String [] args) { Scanner scnr = new Scanner(Sys
Delvig [45]

Answer:

The code at 'Your solution goes here' is in the bold font given

Explanation:

import java.util.Scanner;

public class StudentScores {

   public static void main(String[] args) {

       Scanner scnr = new Scanner(System.in);

       final int SCORES_SIZE = 4;

       int[] oldScores = new int[SCORES_SIZE];

       int[] newScores = new int[SCORES_SIZE];

       int i;

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

           oldScores[i] = scnr.nextInt();

       }

       for (i = 0; i < oldScores.length - 1; ++i) {

           newScores[i] = oldScores[i+1];

       }

       newScores[oldScores.length-1] = oldScores[0];

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

           System.out.print(newScores[i] + " ");

       }

       System.out.println();

   }

}

4 0
3 years ago
Max magnitude Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the
Ira Lisetskai [31]

Answer:

The java program is as follows.

import java.lang.*;

public class Numbers

{

   //variables to hold two numbers

   static int num1=-8, num2=-2;

   //method to return integer with higher magnitude

   public static int maxMagnitude(int userVal1, int userVal2)

   {

       if(Math.abs(userVal1) > Math.abs(userVal2))

           return userVal1;

       else    

           return userVal2;

   }

public static void main(String[] args) {

    int max = maxMagnitude(num1, num2);

 System.out.println("The number with higher magnitude among "+num1+ " and "+num2+ " is "+max);

}

}

OUTPUT

The number with higher magnitude among -8 and -2 is -8

Explanation:

1. Two integer variables are declared to hold the two numbers. The variables are declared at class level (outside main()) and declared static.

2. The variables are initialized with any random value.

3. The method, maxMagnitude(), takes the two integer parameters and returns the number with higher magnitude. Hence, return type of the method is int.

public static int maxMagnitude(int userVal1, int userVal2)

4. This method finds the number with higher magnitude using the Math.abs() method inside if-else statement.

               if(Math.abs(userVal1) > Math.abs(userVal2))

                   return userVal1;

        else    

                   return userVal2;

5. Inside main(), the method, maxMagnitude(), is called. This method takes the two variables as input parameters.

6. The integer returned by the method, maxMagnitude() is assigned to a local integer variable, max, as shown.

      int max = maxMagnitude(num1, num2);

7. The result is displayed to the user as shown.

System.out.println("The number with higher magnitude among "+num1+ " and "+num2+ " is "+max);

8. The class variables and the method, maxMagnitude(), are declared static so that they can be used and called inside main().

9. The variable, max, is called local variable since it can be used only within the main() where it is declared. It is not declared static.

10. The class is declared public since it has the main() method and execution begins with main().

11. The program is saved with the same name as the name of the public class having main(). In this case, the program is saved as Numbers.java.

12. No user input is taken for the two input parameter values. The static variables can be assigned any integer value and the program can be tested accordingly.

8 0
3 years ago
What is a single device that provides functionality of a printer, scanner, copy machine, and perhaps a fax machine called?
saw5 [17]
A device that provides all of the functionality listed in your question, would be a MFP (Multi-Fuction Printer)
4 0
3 years ago
Which of the following Wi-Fi chalking method refers to drawing symbols in public places to advertise open Wi-Fi networks?
dezoksy [38]

Answer War Chalking

Explanation: War chalking is the technique for presenting the WiFi network publicly. This signifies about the WiFi is present but not describes the manner of it , that is whether it is open connection or closed connection.

It can be used by the people in general as well as hackers . Hackers usually tend to attack and hack its security that is present.Hackers then use the WiFi network  is then used for their own work after being hacked.

3 0
3 years ago
Read 2 more answers
Define the following:-<br><br>1) cryptography<br><br>2) Quantum Cryptography​
Readme [11.4K]
1.) the art of writing or solving codes.
2.) the science of exploiting quantum mechanical properties to perform cryptographic tasks.

hope this helps :)
8 0
3 years ago
Read 2 more answers
Other questions:
  • For the MIPS assembly instructions below, what is the corresponding C statement? Assume that the variables f, g, h, i, and j are
    15·2 answers
  • Give two reasons to break up
    11·2 answers
  • Why was Unicode invented?
    11·1 answer
  • Answer if you play PS4 apex legends if you do answer username and first to answer is brainliest
    15·2 answers
  • An empty frame used to reserve space for a picture to be inserted at a later time is known as a _____. shape image picture place
    7·1 answer
  • Code in Java:
    6·1 answer
  • if anyone could help me with this it would be great. I have to turn in a practice resume and im completely lost and have no clue
    7·1 answer
  • What is Error Code: 232011
    11·2 answers
  • Need help:(!!!! I’ll mark brainliest if correct
    5·1 answer
  • Egovernment involves the use of strategies and technologies to transform government by improving the delivery of services and en
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!