Answer:
Change:
print("Season is",season)
To:
print("Season is " + season)
Explanation:
String Concatenation can be done using many ways but not by comma. You can use the + operator like i just did or % operator, join method or format function.
But for now, try using the + operator.
Answer:
In C:
#include <stdio.h>
#include <math.h>
int main(){
float f0,r,temp;
r = pow(2.0,1.0/12);
printf("f0: "); scanf("%f", &f0);
temp = f0;
for(int i = 0; i<=4;i++){
f0 = f0 * pow(r,i);
printf("%.2lf ", f0);
f0 = temp; }
return 0;
}
Explanation:
This declares f0, r and temp as float
float f0,r,temp;
This initializes r to 2^(1/12)
r = pow(2.0,1.0/12);
This prompts the user for f0
printf("f0: "); scanf("%f", &f0);
This saves f0 in temp
temp = f0;
This iterates the number of keys from 0 to 4
for(int i = 0; i<=4;i++){
This calculates each key
f0 = f0 * pow(r,i);
This prints the key
printf("%.2lf ", f0);
This gets the initial value of f0
f0 = temp; }
return 0;
No because the battery will die and it wont run anymore in other cases you would ask another person for help and connect cables to their car.
An array of integers named parkingTickets has been declared and initialized to the number of parking tickets given out by the city police each day since the beginning of the current year.
Explanation:
- A variable named ndays has been declared and initialized to hold the size of the array.
- The first element of the array contains the number of tickets given on January 1; the last element contains the number of tickets given today.
- A variable named mostTickets has been declared, along with a variable k.
- If today were January 18, ndays would have the value 18; if today were February 3, ndays would have the value 34
mostTickets=0;
for (k=0; k< ndays; k++)
{
if (parkingTickets[k]>mostTickets) mostTickets=parkingTickets[k];
}