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
What language are you programming in?
<span>If you are programming in C or C++, you could do something like this: </span>
<span>#include <iostream> </span>
<span>using namespace std; </span>
<span>int main(void) </span>
<span>{ </span>
<span>//declarations </span>
<span>double item1 = 0; </span>
<span>double item2 = 0; </span>
<span>double item3 = 0; </span>
<span>double item4 = 0; </span>
<span>double item5 = 0; </span>
<span>double subtotal = 0; </span>
<span>double total = 0; </span>
<span>double tax = 0; </span>
<span>//Enter Items </span>
<span>cout << "Please enter the price of item 1"; </span>
<span>cin >> item1; </span>
<span>cout << "Please enter the price of item 2"; </span>
<span>cin >> item2; </span>
<span>cout << "Please enter the price of item 3"; </span>
<span>cin >> item3; </span>
<span>cout << "Please enter the price of item 4"; </span>
<span>cin >> item4; </span>
<span>cout << "Please enter the price of item 5"; </span>
<span>cin >> item5; </span>
<span>//Compute subtotal </span>
<span>subtotal = (item1 + item2 + item3 + item4 + item5 + item6); </span>
<span>//Compute amount of tax </span>
<span>tax = subtotal * (.06); </span>
<span>//Compute total </span>
<span>total = subtotal + tax; </span>
<span>//Display subtotal, total, and amount of tax </span>
<span>cout < " The subtotal of the sale is: " << subtotal << endl; </span>
<span>cout < " The amount of sales tax is: " << tax << endl; </span>
<span>cout < " The total of the sale is: " << total << endl; </span>
<span>return 0; </span>
<span>}//end of function main </span>
<span>I know this is a very very basic C++ program but I hope it helps and good luck on your project!</span>
Answer:
sectors
Explanation:
hard disk contain tracks which are further divided into sectors, for storage purposes.
Answer:
Operating systems work like translators because they are able to take software and hardware, and put it all together to work in a way that is readable and usable for the consumer.
Answer:
you can go to settings and try to fix it or contact the people of this website
Explanation: