Answer:
To check if the year comes under each 100th year, lets check if the remainder when dividing with 100 is 0 or not.
Similarly check for 400th year and multiple 0f 4. The following C program describes the function.
#include<stdio.h>
#include<stdbool.h>
bool is_leap_year(int year);
void main()
{
int y;
bool b;
printf("Enter the year in yyyy format: e.g. 1999 \n");
scanf("%d", &y); // taking the input year in yyyy format.
b= is_leap_year(y); //calling the function and returning the output to b
if(b==true)
{
printf("Thae given year is a leap year \n");
}
else
{
printf("The given year is not a leap year \n");
}
}
bool is_leap_year(int year)
{
if(year%100==0) //every 100th year
{
if(year%400==0) //every 400th year
{
return true;
}
else
{
return false;
}
}
if(year%4==0) //is a multiple of 4
{
return true;
}
else
{
return false;
}
}
Explanation:
Output is given as image
CAVA’s Academic Integrity Policy refers to Calfornia Virtual Academic’s policy book for students of their schools, which are public charter schools in the state of California.
In the handbook, it is mentioned that students who commit plagiarism will be required to re-submit the assignment during the first offence; will receive a fail grade for the assignment during the second offence; and will be withdrawn from a course or even the school during the third offence.
Thus the answer to the question is (D) all of the above.
B. Because conditional statements have an IF before stating the condition
Answer:
<em>C++.</em>
#include <iostream>
using namespace std;
////////////////////////////////////////////////////////////////
int main() {
int weekly_hours = 0;
int hourly_rate;
float gross_pay = 0;
cout<<"Enter weekly hours worked: ";
cin>>weekly_hours;
cout<<"Enter hourly rate: ";
cin>>hourly_rate;
cout<<endl;
////////////////////////////////////////////////
if (weekly_hours > 40) {
gross_pay = (weekly_hours*hourly_rate) + ((weekly_hours*hourly_rate)*0.5);
}
else
gross_pay = weekly_hours*hourly_rate;
cout<<"Weekly gross pay: $"<<gross_pay;
////////////////////////////////////////////////
return 0;
}
<h2>Answer:</h2>
<u>The correct option is</u><u> (B) hang up and call back using the banks official phone number</u>
<h2>Explanation:</h2>
There are a lot of cases where people pretend to call from the banks where the receivers have the account. The caller tries to take the information from the receiver and pretends to be the bank official. If there is any doubt then the receiver should hang up the call and call back the official number of the bank to confirm that whether somebody has called from the bank to get the information.