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
Sever21 [200]
3 years ago
5

Write a code to test if a number is equal to 89 or 78

Computers and Technology
1 answer:
ANTONII [103]3 years ago
4 0

number = whatever value you want

if number == 89 or number == 78:

   print("The variable number equals 89 or 78.")

else:

   print("The variable number does not equal 89 or 78.")

You might be interested in
True or false mobile devices need to work within limited screen space
eduard
A phone may have a 4 inch screen and so it cant just extend to 5 inches. So it would he true
3 0
2 years ago
Read 2 more answers
Write a Python 3 program to read from a .csv file containing rates from power companies. Your program should determine the avera
aliya0001 [1]

Answer:

In python:

file = open("rates.csv", "r")

ratecount = 0

ratesum = 0

mylist = []

rates = file.readlines()

for nums in rates:

     num = nums.rstrip('\n')

     mylist.append(int(num))

     for i in num:

           ratesum= ratesum + int(i)

           ratecount = ratecount + 1

print("Maximum Rate: "+str(max(mylist)))

print("Minimum Rate: "+str(min(mylist)))

print("Average Rate: "+str(ratesum/ratecount))

Explanation:

This opens the csv file

file = open("rates.csv", "r")

This initializes the number of rates in the file

ratecount = 0

This initializes the sum of the rates

ratesum = 0

This initializes an empty list

mylist = []

This reads the rates into lines

rates = file.readlines()

This iterates through the rates (as a string)

for nums in rates:

This removes the newline character \n in the rates

     num = nums.rstrip('\n')

This appends the rates (as an integer) to the empty list

     mylist.append(int(num))

The following counts the rates in the file and also sum them up

<em>      for i in num: </em>

<em>            ratesum= ratesum + int(i) </em>

<em>            ratecount = ratecount + 1 </em>

This prints the maximum of the rates

print("Maximum Rate: "+str(max(mylist)))

This prints the minimum of the rates

print("Minimum Rate: "+str(min(mylist)))

This calculates and prints the average rate

print("Average Rate: "+str(ratesum/ratecount))

6 0
3 years ago
Write a program that records high-score data for a fictitious game. the program will ask the user to enter five names, and five
Harman [31]

Scores.cpp

#include <iostream>

#include <string>

using namespace std;

void initializeArrays(string names[], int scores[], int size);

void sortData(string names[], int scores[], int size);

void displayData(const string names[], const int scores[], int size);

int main()

{

   string names[5];

   int scores[5];

   //reading names and scores

   initializeArrays(names, scores, 5);

   //sorting the lists based on score.

   sortData(names, scores, 5);

   //displaying the contents of both arrays

   displayData(names, scores, 5);

 

  return 0;

}

void initializeArrays(string names[], int scores[], int size){

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

       cout<<"Enter the name for score #"<<(i+1)<<": ";

       cin >> names[i];

       cout<<"Enter the score for score #"<<(i+1)<<": ";

       cin >> scores[i];

       }

}

void sortData(string names[], int scores[], int size){

   

       int temp = 0;

       string tempStr = "";

       

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

               for(int j=1; j < (size-i); j++){

                      //checking max score and sorting based on it.

                       if(scores[j-1]< scores[j]){

                               //swap the elements!

                           //swapping scores

                               temp = scores[j-1];

                               scores[j-1] = scores[j];

                               scores[j]=temp;

                               

                               //swapping names

                               tempStr = names[j-1];

                               names[j-1] = names[j];

                               names[j]=tempStr;

                       }

                       

               }

       }

}

void displayData(const string names[], const int scores[], int size){

   cout<<"Top Scorers:"<<endl;

       //printing the elements up to the size of both arrays.

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

           cout<<names[i]<<": "<<scores[i]<<endl;

       }

}

3 0
3 years ago
Some of your non-Windows clients aren't registering their hostnames with the DNS server. You don't require secure updates on the
Ivenika [448]

Answer:

c.Update DNS records dynamically for DHCP clients that don't request updates.

Explanation:

A DNS server is a computer server that contains a database of public IP addresses and their associated host names, and in most cases serves to resolve, or translate, those names to IP addresses as requested.

A DHCP Server is a network server that automatically provides and assigns IP addresses, default gateways and other network parameters to client devices.

Dynamic DNS is a method of automatically updating a name server in the Domain Name Server, often in real time.

5 0
2 years ago
In the context of computer crimes, those who attempt to destroy the infrastructure components of governments and financial insti
elixir [45]

In the context of computer crimes, those who attempt to destroy the infrastructure components of governments and financial institutions are known as <u>d. cyber terrorists</u>.

<u>Explanation</u>:

Cyber crime means crime committed with the help of computer and internet. Cyber terrorism means crime that causes damage to infrastructure components of financial institutions and government office and causes threat to the society.

Cyber terrorists are person who involve in cyber terrorism. The systems used in the governments and financial institutions should be protected with hardware and software to avoid cyber terrorism.

This kind of cyber terrorism is very dangerous, as they hack the system and destroy the valuable information stored in it.

5 0
2 years ago
Other questions:
  • Periodically adding, changing and deleting file records is called file. A) Updating B) Upgrading C) Restructuring D) Renewing E)
    10·2 answers
  • Which part of the faucet is the aerator?
    13·1 answer
  • Which of these can a worksheet within a spreadsheet contain?
    7·2 answers
  • Your task is to write a C program that measures the latencies of various system calls. In particular, you want to know 1) the co
    5·1 answer
  • _____ are independent and not associated with the marketing efforts of any particular company or brand.​
    9·1 answer
  • Does anyone play genshin impact here?
    12·2 answers
  • What are styles? built-in conditional formatting rules formatting applied with the Format Painter defined combinations of format
    15·2 answers
  • If every company is now a technology company, then what does this mean for every student attending a business college
    8·1 answer
  • Can you explain the difference between software and hardware? Tell me 3 examples of each one.
    10·1 answer
  • Why is my internet slow even though the speed test says it is fast
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!