Answer:
#include <iostream>
using namespace std;
int main () {
// for loop execution
int semester_fees=8000;
int b=1;
cout<<"there are 5 years or 10 semester fees breakdown is given below"<<endl;
for( int a = 1; a <=5; a++ ) {
semester_fees = semester_fees*1.03;
cout<<"Semester fees for each of semester"<<b++<<"and"<<b++<<"is:$"<<semester_fees<<endl;
}
return 0;
}
Explanation:
code is in c++ language
Fees is incremented yearly and i have considered only two semester per year
Statement two and three is correct.
Statement 1 is incorrect. A relative reference changes when a formula is copied to another cell while Absolute references remain constant. However, it is safe to say that an absolute address can be preceded by a $ sign before both the row and the column values. It is designated by the addition of a dollar sign either before the column reference, the row reference, or both. Statement C is also correct. A mixed reference is a combination of relative and absolute reference and the formula (= A1 + $B$2) is an example of a mixed cell reference.
Equality and Relational Operators
For the statement to return false, you can simply use the "not equal to" equality operation. The full symbol of this operation is '!=', disregarding the quotes.
<u>Examples:</u>
- [1 != 1] would produce FALSE. Translation: 1 <u>does not equal</u> 1?
- [1 == 1] would produce TRUE. Translation: 1 <u>does</u> 1?
- ["G" != "G] would produce <u>FALSE</u>. Translation: "G" <u>does not equal</u> "G"?
CONCLUSION: Use "!=".
Answer:
weights = []
total = 0
max = 0
for i in range(5):
weight = float(input("Enter weight " + str(i+1) + ": "))
weights.append(weight)
total += weights[i]
if weights[i] > max:
max = weights[i]
average = total / 5
print("Your entered: " + str(weights))
print("Total weight: " + str(total))
print("Average weight: " + str(average))
print("Max weight: " + str(max))
Explanation:
Initialize the variables
Create a for loop that iterates 5 times
Get the values from the user
Put them inside the array
Calculate the total by adding each value to the total
Calculate the max value by comparing each value
When the loop is done, find the average - divide the total by 5
Print the results
Answer:
// program in C++ to check leap year.
// include header
#include<iostream>
using namespace std;
// main function
int main() {
// variable
int inp_year ;
// ask user to enter year
cout<<"Enter year:";
// read year
cin>>inp_year;
// check year is leap or not
if (((inp_year % 4 == 0) && (inp_year % 100 != 0)) || (inp_year % 400 == 0))
// if leap year , print leap year
cout<<inp_year<<" is a leap year.";
else
// print not leap year
cout<<inp_year<<" is not a leap year.";
return 0;
}
Explanation:
Read year from user.Then check if year is divisible by 4 and not divisible by 100 or year is divisible by 400 then year is leap year.otherwise year is not leap year.
Output:
Enter year:1712
1712 is a leap year.