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
Maksim231197 [3]
3 years ago
7

Code Problem 1 in Python 2.

Computers and Technology
1 answer:
jenyasd209 [6]3 years ago
5 0

I've included my code in this image. Best of luck.

You might be interested in
help i was building my pc and i pushed the cpu into the socket really hard until there was an audible crack and it went into the
Fed [463]
Try smashing it with a hammer, always helped me
4 0
3 years ago
Write a main program that prompts users for 5 integers. Use two separate functions to return (NOT print) the highest and lowest
Soloha48 [4]

Answer:

import java.util.Arrays;

import java.util.Scanner;

public class LatinHire {

   public static void main(String[] args) {

       Scanner in = new Scanner (System.in);

       System.out.println("Enter Five integers");

       int num1 = in.nextInt();

       int num2 = in.nextInt();

       int num3 = in.nextInt();

       int num4 = in.nextInt();

       int num5 = in.nextInt();

       int [] intArray = {num1,num2,num3,num4,num5};

       System.out.println(Arrays.toString(intArray));

       System.out.println("The Maximum is "+returnMax(intArray));

       System.out.println("The Minimum is "+returnMin(intArray));

   }

   public static int returnMax(int []array){

       int max = array[0];

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

           if(max<array[i]){

               max= array[i];

           }

       }

       return max;

   }

   public static int returnMin(int []array){

       int min = array[0];

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

           if(min>array[i]){

               min= array[i];

           }

       }

       return min;

   }

}

Explanation:

  1. This is implemented in Java Programming Language
  2. Two Methods are created returnMax(Returns the Maximum Value of the five numbers) and returnMin(Returns the minimum of the five numbers)
  3. In the Main method, the user is prompted to enter five numbers
  4. The five numbers are saved into an array of integers
  5. The returnMax and returnMin methods are called and passed the array as parameter.
  6. The entire array of numbers inputted by the user as well the Max and Min are printed

6 0
3 years ago
Write a program that reads an integer, and then prints the sum of the even and odd integers.
Tasya [4]

Answer:

#include <iostream>  // header file

using namespace std;  // namespace

int main ()

{

int n, x1, i=0,odd_Sum = 0, even_Sum = 0;  // variable declaration

cout << "Enter the number of terms you want: ";

 cin >> n;  // user input the terms

cout << "Enter your values:" << endl;

  while (i<n)  // iterating over the loop

{

cin >> x1;  // input the value

if(x1 % 2 == 0)  // check if number is even

{

even_Sum = even_Sum+x1;  // calculate sum of even number

}

else

{

odd_Sum += x1; // calculate sum of odd number.

}

i++;

}

cout << "Sum of Even Numbers is: " << even_Sum << endl;  // display the sum of even number

cout << "Sum of Odd Numbers is: " << odd_Sum << endl;  // display the sum of odd number

return 0;

}

Output:

Enter the number of terms you want:3

Enter your values:2

1

78

Sum of Even Numbers is:80

Sum of Odd Numbers is:1

Explanation:

In this program we enter the number of terms by user .After that iterating over the loop less then the number of terms .

Taking input from user in loop and check the condition of even. If condition is true then adding the sum of even number otherwise adding the sum of odd number.

Finally print the the sum of the even number and odd integers.

6 0
3 years ago
How long does a baby dolphin stay with its mum
g100num [7]
The nursing usually takes up to 18 months, i.e. one year and a half.

The baby dolphin may however remain with his mum for up to 3-6 years.
5 0
3 years ago
Which option is NOT in the Link to portion of the Insert Hyperlink dialog box?
WARRIOR [948]
Existing file or webpage
4 0
4 years ago
Read 2 more answers
Other questions:
  • Can Any body Define what is search engine in a simple language quick please​
    14·1 answer
  • When the print server processes documents waiting in the queue until the print device is available to accept the print job is ca
    14·1 answer
  • To select a new theme for a slideshow use the blank tile in the ribbon
    9·2 answers
  • Does the game best fiend need wifi to play on the app?
    8·2 answers
  • The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
    11·1 answer
  • A bank is experiencing a DOS attack against an application designed to handle 500IP-based sessions. In addition, the perimeter r
    11·1 answer
  • The use of computer in a modern world is as a result of complexity. true or false
    6·1 answer
  • Write a program code to accept the names of 3 users and generate a user name as shown in the example. Accept the name of 3 user
    9·1 answer
  • In cell K8, create a formula using the SUM function that calculates the total of the range D17:D20 and subtracts it from the val
    6·1 answer
  • Which items in the list below are viruses. Click in the box to select your answer(s).
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!