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
insens350 [35]
3 years ago
13

Write the Python programs for the

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

Answer:

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

if (num % 2) == 0:

print("{0} is Even number". format(num))

else:

print("{0} is Odd number". format(num))

You might be interested in
Write a program that accepts a file name from the command line, then initializes an array with test data using that text file as
postnew [5]

Answer:

Complete code is given below:

Explanation:

import java.io.BufferedReader;

import java.io.FileNotFoundException;

import java.io.FileReader;

import java.io.IOException;

import java.util.Arrays;

import java.util.Scanner;

public class ArrayCalcs {

private int size;

String [] parts =null;

// based on number of elements in file, array will create.

double[] arr=null;

public void readFile(String file){

try{

FileReader fr = new FileReader(file+".txt");

BufferedReader br = new BufferedReader(fr);

String line = br.readLine();

int count = 0;

while (line != null) {

parts = line.split(" ");

for( String w : parts)

{

count++;

}

line = br.readLine();

}

size=count;

arr=new double[size];

for(int i=0;i<size;i++){

arr[i]=Double.parseDouble(parts[i]);

}

// System.out.println(count);

// System.out.println(Arrays.toString(parts));

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

} catch (FileNotFoundException ex){

System.out.println("This file does not exist");

} catch (IndexOutOfBoundsException e){

System.out.println("Thie file has more than 7 lines");}

catch (IOException e) {

System.out.println(e.getMessage());

}

}

public double getTotal(){

double sum=0.0;

for(double d:arr){

sum=sum+d;

}

return sum;

}

public double getAverage(){

double avg=getTotal()/arr.length;

return avg;

}

public double getHighest(){

double high=arr[0];

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

if(arr[i] > high)

high = arr[i];

}

return high;

}

public double getLowest(){

double low=arr[0];

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

if(arr[i] < low)

low= arr[i];

}

return low;

}

public static void main(String[] args) {

Scanner s = new Scanner(System.in);

System.out.println("Enter file name:");

String file=s.next();

ArrayCalcs ac=new ArrayCalcs();

ac.readFile(file);

System.out.println(" Highest Element: "+ac.getHighest());

System.out.println("Lowest Element: "+ac.getLowest());

System.out.println("Total: "+ac.getTotal());

System.out.println("Average: "+ac.getAverage());

}

}

4 0
3 years ago
Which of the following should be the first page of a report?
hram777 [196]

Answer:

Title page should be the first page of a report.

hope it helps!

6 0
3 years ago
The negotiation process involves several steps such as: preparing for negotiation; knowing your walk-away point; and working tow
Rina8888 [55]

Answer:

TRUE

Explanation:

Negotiation may be defined as the process or a method with the help of which people try to settle their differences or they try to come to a conclusion in a matter of differences. Here an agreement or a compromise is reached without any dispute and arguments. It is a skill.

It involves preparing for the negotiation with other person, understanding and knowing when one needs to walk out of the negotiation process to avoid arguments and working towards the common goal of achieving an agreement.

Therefore, the answer is true.

6 0
3 years ago
Question very important cause after my school is over at 5 'oclock I will be playing rocket league if anyone wants to play just
jarptica [38.1K]

Answer:

So can u tell me wut is ur question...It is not understandable

6 0
3 years ago
_________ is the method used by password crackers who work with pre-calculated hashes of all passwords possible within a certain
sergij07 [2.7K]

Answer:

DOS, Denail of Service Attacks

Explanation:

5 0
2 years ago
Other questions:
  • MinMax is a function that takes five arguments and returns no value. The first three arguments are of type int. The last two arg
    14·1 answer
  • After brainstorming engineers may refine their ideas by making
    8·1 answer
  • The program evaluation and review technique (PERT) is __________. a. a network-based technique in which there is a single time e
    15·1 answer
  • The double equal sign (==) is used to compare values. <br>true or false​
    14·1 answer
  • Describe the following types of Cloud services:
    11·1 answer
  • CAN YOU PLEASE HELP WITH THIS DUE IN 10 MINUTES
    8·1 answer
  • Pls help I will give points
    7·1 answer
  • Imaging a computer is part of what phase of conversion?
    14·1 answer
  • What was the in-app phrase listed as SC answer? <br> A) MasterCard <br> B) No fee<br> C) Apple Pay
    15·2 answers
  • How many combinations of 1s and Os can we make with 6 place values?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!