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
Valentin [98]
3 years ago
5

Need help on Assignment 4: Evens and Odds

Computers and Technology
1 answer:
Sliva [168]3 years ago
8 0

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

even = 0

odd = 0

for x in range(n):

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

   if num % 2 == 0:

       even += 1

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

   else:

       odd += 1

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

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

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

This works for me. Best of luck.

You might be interested in
Computers represent color by combining the sub-colors red, green, and blue (rgb). Each sub-color's value can range from 0 to 255
Effectus [21]

Answer:

<em>The programming language is not stated; However, I'll answer the question using C++ programming language, </em>

<em>This program uses comments for explanations  </em>

<em>Program starts here</em>

#include<iostream>

using namespace std;

int main()

{

//Declare Array

int colorcode[3],graycode[3];

//Prompt user for color code

cout<<"Enter Color Code (One on a line)"<<endl<<"Inout Range is 0 to 255"<<endl;

for(int i = 0;i<3;i++)

{

 ccode:  

 cout<<"Enter Color Code "<<i+1<<": ";

 cin>>colorcode[i];

 if(colorcode[i]<0 || colorcode[i]>255)

 {

  cout<<"Input Range is 0 to 255"<<'\n';

  goto ccode;

 }

}

//Initialize smallest to colorcode[0]

int smallest = colorcode[0];

//Determine smallest

for(int i = 0;i<3;i++)

{

 if(colorcode[i]<smallest)

 {

  smallest = colorcode[i];

 }

}

//Determine Graycode

for(int i = 0;i<3;i++)

{

 graycode[i] = colorcode[i] - smallest;

}

//Display Result:

cout<<"Color Code: "<<"(";

for(int i = 0;i<3;i++)

{

 if(i!=2)

 {

 cout<<colorcode[i]<<",";  

 }

 else

 {

  cout<<colorcode[i]<<")"<<endl;  

 }  

}

cout<<"Gray Code: "<<"(";

for(int i = 0;i<3;i++)

{

 if(i!=2)

 {

 cout<<graycode[i]<<",";  

 }

 else

 {

  cout<<graycode[i]<<")"<<endl;  

 }  

}

return 0;

}

8 0
3 years ago
Fill in the blank with the correct response.
Karo-lina-s [1.5K]

Answer:

logical

Explanation:

4 0
3 years ago
Read 2 more answers
2. Select the things you can do when working with rows in columns in a spreadsheet:
Kay [80]
I think you can do all of those things to rows and columns when working with a spreadsheet.
5 0
3 years ago
A data analyst adds descriptive headers to columns of data in a spreadsheet. How does this improve the spreadsheet?.
Marrrta [24]

The way that adding descriptive headers to columns of data in a spreadsheet improve the spreadsheet is that; It adds context to the data.

  • Usually in spreadsheets in Microsoft Excel, we could just naturally use letters like A, B or C or even numbers like 1, 2, or 3 as title headers for columns. However, sometimes it becomes necessary to use descriptive headers. This is because the person reading it may not be able to easily comprehend the details or numbers in that particular column.

  • Thus, in order to add more context to the data in the column of the spreadsheet and improve understanding of context using descriptive headers is very useful.

Read more on excel spreadsheets at; brainly.com/question/25863198

7 0
2 years ago
Assume that the "read/write file to hard disk" library is part of the kernel. Assume that this library uses 1MB of RAM. Assume t
scZoUnD [109]

Answer:

The Answer is 1 MB.

Explanation:

In order to replace the library it must write 0 MB to hard drive then only it can be replaced. Therefore 1 MB is the correct answer.

5 0
4 years ago
Other questions:
  • JAVA
    7·1 answer
  • The analysis of how people relate to each other is known as?
    6·1 answer
  • How to learn how to use computers
    9·1 answer
  • How many electrons are there in an atom of carbon? A. Four B. Eight C. Six D. One
    15·2 answers
  • Which utility would you use to return the common name of the computer you're at? Execute this command and submit screen shots.
    11·1 answer
  • Write the constructor for the Theater class. The constructor takes three int parameters, representing the number of seats per ro
    7·1 answer
  • an individual’s Body Mass Index (BMI) is a measure of a person’s weight in relation to their height. it is calculated as follows
    6·1 answer
  • True or False: Variablename must start with a number.
    13·1 answer
  • Suppose we want an error correcting code that will allow all single-bit errors to be corrected for memory words of length 15. 1.
    5·1 answer
  • The process of identifying and eliminating bugs in a software program is most generally called reproducing the problem. diagnosi
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!