1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sonbull [250]
3 years ago
11

Write a function that determines if a given year is a leap year. You can either pass a singleinteger year or your date structure

to this function. Hint: Review Lab 2. 3. Write a function that returns the number of days in a month. Pass your date structure to this function and account for leap years using the function in #2.
Computers and Technology
1 answer:
Elis [28]3 years ago
8 0

A function that determines if a given year is a leap year:

#include<stdio.h>

int main()

{

//fill the code

int year, month;

scanf(“%d %d”,&month,&year);

if(!Leapyear(month, year))

{

if(month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)

printf(“Number of days is 31”);

else if(month == 2)

{

printf(“Number of days is 28”);

}

else

printf(“Number of days is 30 “);

return 0;

 }

}

int Leapyear(int month, int year)

{

if((month == 2) && (year%4 == 0) || ((year%100 == 0) &&(year%400 == 0)))

{

printf(“Number of days is 29”);

return 1;

}

else

return 0;

}

You might be interested in
A low concentration of market power has positive affects. A low concentration of market share has which of the following effects
lisov135 [29]
A or b i think hope it helps good luck and i hope it helps
6 0
3 years ago
You are to calculate the property tax for tax payers. You will ask the county tax clerk if they want to run the program and init
andre [41]

Answer:

Explanation:

The following code is written in Java. It creates the loop as requested and validates the information provided before continuing, if the information is invalid it prints "Invalid Information to the screen" and asks the user to enter the information again. Finally, outputing all the requested information at the end of the program. The code has been tested and the output can be seen in the attached image below.

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       int totalValues = 0;

       int totalTaxes = 0;

       int count = 0;

       while(true) {

           int lotNumber, value;

           double tax;

           System.out.println("Would you like to add an Entry: 1=Yes 0=No");

           int answer = in.nextInt();

           if (answer == 1) {

               System.out.println("Please enter lot number: ");

               lotNumber = in.nextInt();

               if ((lotNumber >= 0) && (lotNumber <= 999999)) {

                   System.out.println("Please enter assessed value: ");

                   value = in.nextInt();

                   tax = value * 0.05;

                   System.out.println("Lot Number: " + lotNumber);

                   System.out.println("Property Value: " + value);

                   System.out.println("Property Tax: " + tax);

                   totalTaxes += tax;

                   totalValues += value;

                   count += 1;

               } else {

                   System.out.println("Invalid Lot Number");

               }

           } else {

               break;

           }

       }

       int average = totalTaxes / count;

       System.out.println("Total Property Values: " + totalValues);

       System.out.println("Total Property Taxes: " + totalTaxes);

       System.out.println("Average Property Tax" + average);

   }

}

8 0
3 years ago
A spreadsheet program is a computerized version of
MrRa [10]

Answer:

A spreadsheet program is a computerized version of paper accounting.

Explanation:

A spreadsheet program is a computerized version of a paper accounting worksheet where everyone can easily use the sheet according to their need. For example, a spreadsheet can be used as a data entry sheet, as arithmetic operations. Data entry in paper accounting was done manually with paper whereas spreadsheet has cells in it to record the entries. Similarly, other operations such as recording the data, performing analytical operations were part of old system and these are now used in spreadsheet as a basic function.  In short, the spreadsheet is a very friendly application where values can be analyzed, stored, and modified as per requirements. These all defined tasks are part of paper based accounting now done using computer program.

7 0
4 years ago
Read 2 more answers
Suppose I have two DFAs D1, D2 and I perform the product construction on them to get a DFA for the union of their languages. Wha
Musya8 [376]

Answer:

Explanation:

If L(D1) = L(D2), the D has every state being final

If L(D1) = L¯(D2), the D has every state being final

If L(D1) = ∅, then L(D) = L(D2).

If L(D1)=Σ, L(D) = L(D2)

8 0
3 years ago
A computer has __________processing device
Artist 52 [7]

Answer:

electronic processing device

4 0
3 years ago
Other questions:
  • Is Apple a consumer or luxury brand? Give examples.
    10·1 answer
  • What is the target audience for this poster?
    5·2 answers
  • A(n) _____ measures the ability to juggle a variety of demands, as in a manager's job where the candidate is presented with simu
    8·1 answer
  • How many levels of full body protective clothing are there? A. Four B. Seven C. Six D. Two
    14·2 answers
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • You want to calculate a bonus if the sold price was at least equal to the listing price, and if the house sold within 30 days af
    6·1 answer
  • Which software programs should students avoid using to create and submit course work? (Choose all that apply). Word, Pages, Numb
    13·1 answer
  • What type of computer/device do you have i need it for a survey and it due today soooooooooooooo
    14·1 answer
  • Why is it important to think about the programming language to use?
    6·1 answer
  • 1. A _______ causes the computer program to behave in an incorrect or unexpected way.
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!