answer.
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
Airida [17]
2 years ago
8

Edhesive: Assignment 4: Evens and Odds

Computers and Technology
1 answer:
solniwko [45]2 years ago
6 0

Answer:

Written in Python

n = int(input("How many numbers do you need to check? "))

odd = 0

even = 0

for i in range(1,n+1):

     num = int(input("Enter Number: "))

     if num%2 == 0:

           print(str(num)+" is an even number")

           even = even + 1

     else:

           print(str(num)+" is an odd number")

           odd = odd + 1  

print("You entered "+str(even)+" even number(s).")

print("You entered "+str(odd)+" odd number(s).")

Explanation:

<em>I've added the full source code as an attachment where I use comments (#) as explanation</em>

Download txt
You might be interested in
A company has deployed four 48-port access layer switches to a switch block. For redundancy each access layer switch will connec
NISA [10]

Answer:

The answer is "176".

Explanation:

In the given question there is a total of 192 switch ports, which are available for the 48-port switches. And for four access points, 8 trunk links that are 2 per access layer switch will be required. In every connexion of the trunk include two significantly modified-ports on the circuits throughout the access layer. With trunk connexions to both the communication network controller switches, a total of 17 switcher ports is required, allowing 176 access points for end system connectors.

3 0
2 years ago
c++ You are given an array A representing heights of students. All the students are asked to stand in rows. The students arrive
Lilit [14]

The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.

#include<stdio.h>

#include<string.h>

 int* uniqueValue(int input1,int input2[])

 {

   int left, current;

   static int arr[4] = {0};

   int i      = 0;

     for(i=0;i<input1;i++)

      {

         current = input2[i];

         left    = 0;

         if(current > 0)

         left    = arr[(current-1)];

      if(left == 0 && arr[current] == 0)

       {

       arr[current] = input1-current;

       }

       else

   {

       for(int j=(i+1);j<input1;j++)

       {

           if(arr[j] == 0)

           {

               left = arr[(j-1)];

               arr[j] = left - 1;

           }

       }

   }

}

return arr;

}

4 0
2 years ago
Write a public static method named printArray, that takes two arguments. The first argument is an Array of int and the second ar
Serjik [45]

Answer:

Written in Java

public static void printArray(int myarr[], String s){

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

           System.out.print(myarr[i]+s);

       }

   }

Explanation:

This defines the static method alongside the array and the string variable

public static void printArray(int myarr[], String s){

The following iteration iterates through the elements of the array

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

This line prints each element of the array followed by the string literal

           System.out.print(myarr[i]+s);

       }

   }

The method can be called from main using:

<em>printArray(myarr,s);</em>

Where myarr and s are local variables of the main

5 0
2 years ago
Your computer has a quad-core processor that supports multithreading installed. given that the system is running windows, how ca
AlexFokin [52]
By using cpu-z or the performance ran in taskmgr
8 0
2 years ago
The ratio of Chris an iood Dom's ages is
irinina [24]

Answer:

28 years

Explanation:

Let's represent present age of Chris and Dom as C and D respectively. Then since ratio of present age of Chris and Dom is 3:4. Therefore,

\frac{C}{D}=\frac{3}{4}

C=\frac{3}{4}D   ...(1)

Now, it is given that in 7 years their age ratio will become 4:5. Therefore,

\frac{C+7}{D+7}=\frac{4}{5}

5C+35=4D+28\\

Using value of C from equation(1),

5\times\frac{3}{4}D-4D=28-35

15D-16D=-28\\-D=-28\\ D=28

Thus, present age of Dom is 28 years.

8 0
2 years ago
Other questions:
  • Using the expected format, of putting key information where the reader can’t find it, is an example of?
    8·2 answers
  • Which are methods used to improve reading fluency? Check all that apply. Practicing with a weak reader listening to a fluent rea
    5·2 answers
  • Zoey has brought her computer in for servicing. When she dropped off her computer, she mentioned that her computer will sometime
    15·2 answers
  • covers a wide variety of applications such as web and computer-based training (CBT), and social networks. a. E-learning b. Model
    10·1 answer
  • Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
    10·1 answer
  • Suppose that a class named ClassA contains a private nonstatic integer named b, a public nonstatic integer named c, and a public
    14·1 answer
  • Why do agriculture and natural resource systems vary from state to state?
    8·1 answer
  • How do many corporations most likely manage the health and safety of their employees and the workplace?
    13·1 answer
  • Laura is the first person in her SDLC team to detect and predict security vulnerabilities in the software. In which phase is Lau
    11·1 answer
  • You are responsible for a rail convoy of goods consisting of several boxcars. You start the train and after a few minutes you re
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!