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
Marysya12 [62]
3 years ago
5

4.7 code practice question 2 edhesive i cant figure out the code for this problem csn anyone help me?

Computers and Technology
1 answer:
rodikova [14]3 years ago
8 0

Answer:

See Explanation

Explanation:

<em>See attachment for complete question</em>

The programming language is not stated; I'll answer using Python and Java

Python:

low = 56

high = 70

for i in range(low,high+1):

    print(i)

Java:

public class PrintOut{

public static void main(String [] args)

{

int low = 56; int high = 70;

for(int i = low; i<=high;i++)

System.out.print(i+" ");

}

}

For both codes, the explanation is:

The code starts by initializing the range of the print out to 56 and 70

Next, the code segment used an iteration that loops through 56 and 70 and print each digit in this range (both numbers, inclusive).

You might be interested in
(Java) Write a program that accepts a number of minutes and converts it both to hours and days. For example, 6000 minutes is 100
iogann1982 [59]
Import java.util.Scanner;
public class MinutesConversion {
private static Scanner inputDevice;
public static void main(String[] args) {
int minutes, hours;
float days; // float for decimal point

inputDevice = new Scanner(System.in);
System.out.println("Please enter minutes for conversion >> ");
minutes = inputDevice.nextInt();
hours = minutes / 60;
days = hours / 24.0f;


System.out.println(+ minutes + " minutes is " + hours + " hour(s) or" + days " days");
}
}
6 0
3 years ago
Write a static method middleValue that takes three int parameters, and returns a int . It should return the middle value of the
anygoal [31]

We use if-else structure to check the each possible scenario and return the median accordingly in the middleValue() method. The main is also provided so that you can test the method.

Comments are used to explain the each line.

You may see the output in the attachment.

public class Main

{

public static void main(String[] args) {

   

    //call the method for different scenarios

    System.out.println(middleValue(1, 2, 3));

    System.out.println(middleValue(1, 3, 2));

    System.out.println(middleValue(2, 1, 3));

    System.out.println(middleValue(2, 3, 1));

    System.out.println(middleValue(3, 1, 2));

    System.out.println(middleValue(3, 2, 1));

 

}

       //method that takes three int and returns an int

public static int middleValue(int n1, int n2, int n3) {

    //set the median as n1

    int median = n1;

   

    //check the situation where the n1 is the highest

    //if n2 is greater than n2 -> n1 > n2 > n3

    //if not -> n1 > n3 > n2

    if(n1 > n2 && n1 > n3){

        if(n2 > n3)

            median = n2;

        else

            median = n3;

    }

   

    //check the situation where the n2 is the highest

    //if n3 is greater than n1 -> n2 > n3 > n1

    //if not -> n2 > n1 > n3

    //note that we set the median as n1 by default, that is why there is no else part

    else if(n2 > n1 && n2 > n3){

        if(n3 > n1)

            median = n3;

    }

   

    //otherwise, n3 is the highest

    //if n2 is greater than n1 -> n3 > n2 > n1

    //if not -> n3 > n1 > n2

    //note that we set the median as n1 by default, that is why there is no else part

    else{

        if(n2 > n1)

            median = n2;

    }

   

    return median;

}

}

You may see another if-else question at:

brainly.com/question/13428325

6 0
3 years ago
It keeps saying “something is going wrong oops!” when i click on my brainly notifications what do I do
AveGali [126]

Answer:

check your app permissions it may be blocking them or try resetting the app

4 0
3 years ago
In this lab, you complete a Python program that calculates an employee's annual bonus. Input is an employee's first name, last n
HACTEHA [7]

Answer:

The program is as follows (See attachment)

Comments are used to explain some lines

Fname = input("Enter Employee First Name: ")

Lname = input("Enter Employee Last Name: ")

Salary = float(input("Enter Employee Salary: "))

Ratings = int(float(input("Enter Employee Ratings: ")))

#Initialize bonus rate to 0; This will be used if ratings is 4 or 4

bonusRate = 0.0

if Ratings == 1:

       bonusRate =0.25 #If ratings is 1, bonus rate is 0.25

elif Ratings == 2:

       bonusRate = 0.15 #If ratings is 2, bonus rate is 0.15

elif Ratings == 3:

       bonusRate = 0.1 #If ratings is 3, bonus rate is 0.1

bonus = Salary * bonusRate

print(Lname+" "+Fname+"'s employee bonus is "+str(bonus))

#End of Program

Explanation:

The program saves the employee's first name and last name in variables Fname and Lname, respectively

The employee's salary is saved as float datatype in variable Salary

The employee's ratings is saved as int datatype in variable Ratings

For ratings greater than or equal to 4, the bonusRate is set to 0.0; this is done on line 6 of the program

Line 7 to 12 check if employee Ratings is 1, 2 or 3 and the respective bonusRate is used

Line 13 calculates the employee's bonus

Line 14 prints the employee's bonus

The program is ended on line 15

8 0
3 years ago
Suppose you are implementing the address book feature for a cellphone. The address book needs to be kept sorted by person’s last
NemiM [27]

Answer:

Sorted linked list

Explanation:

  • A sorted linked list can be used for sorting the last name and support fast access while queried by the last name.
  • The hash table cannot be used because it could have a problem if there would be more buckets to handle than the expected.
  • The binary search table is implemented as the hash table hence both will give the same results.
8 0
3 years ago
Other questions:
  • If you have an application that is not responding and you want to force it to shut down, whichsystem utility can you use?
    8·1 answer
  • A major ozone depletion happened in the 1900s. What was it caused by
    10·2 answers
  • An increase in Consumption will ___________ in the Classical Model of Aggregate Demand.
    13·1 answer
  • Who is father of computer <br>​
    8·1 answer
  • Refer to the following statement: “We have implemented several IT solutions:
    14·1 answer
  • Llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
    7·1 answer
  • Write a function that receives three StaticArrays where the elements are already i n sorted order and returns a new Static Array
    11·1 answer
  • When making decisions, it is important to remember that ______.
    8·2 answers
  • An employee sets up an automation that transfers files in a specific folder on their PC to a remote drive for archiving, provide
    11·1 answer
  • Jim wants to shoot a video. This requires him to move from one place to another. Which type of camera support should Jim use?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!