Answer:1 3 and 5 is Columns and 2 4 and 6 is Rows theres your answer.
Explanation: its self explanatory.
Information commination technology :)
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
Answer:
This will work for most languages, but this is mainly for c#. Double check what language your using before putting in this answer.
Console.WriteLine("What grade are you in?");
int grade = Convert.ToInt32(Console.ReadLine());
if (grade == 9)
{
Console.WriteLine("Freshman");
}
if (grade == 10)
{
Console.WriteLine("Sophomore");
}
if (grade == 11)
{
Console.WriteLine("Junior");
}
if (grade == 12)
{
Console.WriteLine("Senior");
}
if (grade < 8)
{
Console.WriteLine("Not in High School");
}
Explanation:
The first line asks what grade are you in, then when the user types in the grade it saves it in a variable. We then use that variable for the conditionals. The conditional states, whatever grade level your in, it prints your high school year title. If anything is lower than 8, it will print not in high school.
Answer:
import java.util.Scanner; public class Salesman2 {
public static void main(String[] args) { // TODO Auto-generated method stub double CommissionRate;
double TotalSales, Commission;
Scanner Read = new Scanner (System.in); System.out.println("Please enter total sales "); TotalSales=Read.nextDouble();
if (TotalSales<500)
CommissionRate=0.0;
else if (TotalSales>=500 && TotalSales <1000) CommissionRate=0.05;
else
CommissionRate=0.08;}
Commission = CommissionRate * TotalSales;
System.out.println("The Commision is: "+ Commission); }
}
}