Answer:
Check the explanation
Explanation:
Here is the program with function definition and two sample calls.
Code:
#include <iostream>
using namespace std;
//checkMe FUNCTION which takes values a, b and c
void checkMe(char &a, int &b, int &c)
{
//if sum of b and c is negative and a is 'n', b and c are set to 0, otherwise a is set to 'p'
if((b+c)<0 && a=='n')
{
b = 0;
c = 0;
}
else
{
a = 'p';
}
}
int main()
{
//first test case when else part is executed
char a = 'n';
int b = 5;
int c = 6;
checkMe(a, b, c);
cout<<a<<" "<<b<<" "<<c<<endl;
//second test case when if part is executed
a = 'n';
b = -4;
c = -5;
checkMe(a, b, c);
cout<<a<<" "<<b<<" "<<c<<endl;
return 0;
}
Kindly check the Output below:
if your in school and always are getting into trouble the school will always be checking your records
Answer:
It should be the Central processing unit, as it is the part where information is calculated in the compute, but RAM is also an internal working, used for temporarily storing information. I would Go with CPU to be safe.
Answer:
a) printf("%-5.3e",x);
b) printf("%10llu",x);
<h3>
Explanation:</h3>
We can assign any value to x at the start of program:
For Example:
float x = 72.149;
Then in order to print exponential notation, left justified, in field size of 5 with 3 digits after the decimal point, we need to use the following format:
printf("%-5.3e",x);
where e represent exponential notation.
5 represents field size of 5 and 3 represents digits after decimal point.
In order to print x as right justified, in a 11 digit field, we need to use the following format:
printf("%10llu",x);
Answer:
class Pet():
def __init__(self, name, age, weight, animal_type, breed):
self.name = name
self.age = age
self.weight = weight
slef.aT = animal_type
self.breed = breed
def set_name(self, name):
self.name = name
def get_name(self):
return self.name
def set_age(self, age):
self.age = age
def get_age(self):
return self.age
def set_weight(self, weight):
self.weight = weight
def get_weight(self):
return self.weight
def set_Type(self, type):
self.aT = type
def get_Type(self):
return self.aT
def set_breed(self, breed):
self.breed = breed
def get_breed(self):
return self.breed
def toString(self):
print(f"The pet {self.name} is {self.age} year old and weighs {self.weight}lbs. The pet is a {self.breed} breed of {self.aT}.")
Explanation:
The python program defines a class called Pet that has five features namely name, age, weight, animal_type, and breed of the animal. The set and get methods of the class are the mutators and accessor respectively. The final method of the class is the 'toString' method that prints the summary of the Pet object instance.