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
KengaRu [80]
4 years ago
9

Program to store temperature of two different cities for a week and display it.#include using namespace std; const int CITY = 2;

const int WEEK = 7; int main() { int temperature[CITY][WEEK]; cout << "Enter all temperature for a week of first city and then second city. \n"; // Inserting the values into the temperature array for (int i = 0; i < CITY; ++i) { for(int j = 0; j < WEEK; ++j) { cout << "City " << i + 1 << ", Day " << j + 1 << " : "; cin >> temperature[i][j]; } } cout << "\n\nDisplaying Values:\n"; // Accessing the values from the temperature array for (int i = 0; i < CITY; ++i) { for(int j = 0; j < WEEK; ++j) { cout << "City " << i + 1 << ", Day " << j + 1 << " = " << temperature[i][j] << endl; } } return 0; }
Computers and Technology
1 answer:
Naddik [55]4 years ago
5 0

Answer:

Your solution is correct. Let me explain how it works so that it will be clearer for you

Explanation:

Two constant values are defined for city and week

The 2D temperature array is declared taking the city as rows and week as columns, rows will hold the cities and columns will hold the temperature for the day of the city

A nested for loop is created to initialize all the elements in the array using cin function to assign values accordingly

When the first loop is done, another nested for loop is created to output the all the elements in the array

You might be interested in
Which memory device is most appropriate for backing up a computer’s hard drive?
Luba_88 [7]
It depends on how much storage. I usually connect mine to another hard drive.
4 0
4 years ago
Assignment 8: Personal Organizer (in edhesive or python please)
serg [7]

Answer:

eventName = []

eventMonth = []

eventDay = []

eventYear = []

def addEvent():

   userEventName = input("Enter event name: ")

   userEventMonth = int(input("Enter event month (1-12): "))

   userEventDay = int(input("Enter event day(1-31): "))

   userEventYear = int(input("Enter event year (Ex:2020): "))

   userEventMonth = validateMonth(userEventMonth)

   userEventDay = validateDay(userEventMonth,userEventDay,userEventYear)

   

   eventName.append(userEventName)

   eventMonth.append(userEventMonth)

   eventDay.append(userEventDay)

   eventYear.append(userEventYear)

   

def validateMonth(month):

   if month >= 1 and month <= 12:

       return month

   else:

       return 1

def validateDay(month,day,year):

   # invalid days

   if day < 1 or day > 31 :

       return 1

   

   # if the month is february

   if month == 2:

       isleap = False

       if year%4 == 0:

           if year%100 == 0:

               if year%400 == 0:

                   isleap = True

           else:

               isleap = True

       # if the year is leap

       if isleap:

           if day < 30:                

return day

           else:

               return 1

       else:

            if day < 29:

               return day

            else:

               return 1

           

    # month with 31 days

   if month in [1,3,5,7,8,10,12]:

       return day

    # month with 30 days

   if month in [4,6,9,11] and day < 31:

       return day

   else:

       return 1

           

def printEvents():

   print("****** LIST OF EVENTS *********")

   

   months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',

         'August', 'September', 'October', 'November', 'December']

   

   for index in range(len(eventName)):

       print(eventName[index])

       print("Date: "+months[eventMonth[index] -1]+ " " + str(eventDay[index]) + ", " + str(eventYear[index]))

def printEventsForMonth(month):

   months = ['January', 'February', 'March', 'April', 'May', 'June', 'July',

         'August', 'September', 'October', 'November', 'December']

   print("****** EVENTS IN " + months[month -1] + " *********")

   

   for index in range(len(eventName)):

       if eventMonth[index] == month:

           print(eventName[index])

           print("Date: "+months[eventMonth[index] -1]+ " " + str(eventDay[index]) + ", " + str(eventYear[index]))

userChoice = "yes"

while userChoice.upper() != "NO":

   addEvent()

   userChoice = input("Do you want to enter another event? NO to stop: ")

printEvents()

Explanation:

hope this saved somebody from a mental breakdown :)

3 0
4 years ago
Read 2 more answers
George and Miguel want to know more about their local and online competitors and about the retail industry. What is the best way
fgiga [73]
I would go with all of the above because if you want to find out everything you can then you should explore every option you get.
8 0
3 years ago
Read 2 more answers
What are the different parameters for the shape functions
Ugo [173]
In probability theory and statistics, a shape parameter is a kind of numerical parameter of a parametric family of probability distributions.[1]

Specifically, a shape parameter is any parameter of a probability distribution that is neither a location parameter nor a scale parameter (nor a function of either or both of these only, such as a rate parameter). Such a parameter must affect the shape of a distribution rather than simply shifting it (as a location parameter does) or stretching/shrinking it (as a scale parameter does).

Contents
Estimation Edit

Many estimators measure location or scale; however, estimators for shape parameters also exist. Most simply, they can be estimated in terms of the higher moments, using the method of moments, as in the skewness (3rd moment) or kurtosis (4th moment), if the higher moments are defined and finite. Estimators of shape often involve higher-order statistics (non-linear functions of the data), as in the higher moments, but linear estimators also exist, such as the L-moments. Maximum likelihood estimation can also be used.

Examples Edit

The following continuous probability distributions have a shape parameter:

Beta distribution
Burr distribution
Erlang distribution
ExGaussian distribution
Exponential power distribution
Fréchet distribution
Gamma distribution
Generalized extreme value distribution
Log-logistic distribution
Inverse-gamma distribution
Inverse Gaussian distribution
Pareto distribution
Pearson distribution
Skew normal distribution
Lognormal distribution
Student's t-distribution
Tukey lambda distribution
Weibull distribution
Mukherjee-Islam distribution
By contrast, the following continuous distributions do not have a shape parameter, so their shape is fixed and only their location or their scale or both can change. It follows that (where they exist) the skewness and kurtosis of these distribution are constants, as skewness and kurtosis are independent of location and scale parameters.

Exponential distribution
Cauchy distribution
Logistic distribution
Normal distribution
Raised cosine distribution
Uniform distribution
Wigner semicircle distribution
See also Edit

Skewness
Kurtosis
Location parameter
4 0
4 years ago
Lisa is modifying a spreadsheet. Which view enables her to see how her changes will look when she prints the spreadsheet?
emmainna [20.7K]
The page layout view

The page layout view is useful for printing spreadsheets. It lets you review what you print and enables you to get a nice feel of the page when it is printed. All of the functions of the standard view are enabled and a few extra tools like ruler and header and footer fields that help achieve an awesome finish to your page.

 



5 0
4 years ago
Read 2 more answers
Other questions:
  • If you are asked to bring in agile way of working into the way a meeting runs, which one among the listed options will you imple
    11·1 answer
  • Which component of a computer is its input device and what role does it play in a document?
    6·1 answer
  • It is important to create an IT security program structure that aligns with program and organizational goals and describes the o
    6·1 answer
  • What is the correct term for a set of established guidelines for actions (which may be designated by individuals, teams, functio
    13·1 answer
  • Whay device is recommended to use to install windows 10
    13·1 answer
  • A chain of coffee servers is sending a spreadsheet of projected costs and profits to some of its investors. When, Kyle, the admi
    7·1 answer
  • Writing the E-mail:
    5·1 answer
  • When you print documents on your laser printer, you see residue from previous images on the output. What two things are the most
    12·1 answer
  • When you start a new, blank document, you usually end up changing the font to arial 11. 5 point. How can you make these settings
    8·1 answer
  • If the cpu is fast but the bus speed is slow, that condition is called?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!