Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Nested if else C# CPSC1012 In-class Exercise #4-Decision Structure: Logical Operators/Nested if Student Name: Student Mark: /5 INSTRUCTIONS Complete the requirements of this assignment on

image text in transcribed

Nested if else

C#

CPSC1012 In-class Exercise #4-Decision Structure: Logical Operators/Nested if Student Name: Student Mark: /5 INSTRUCTIONS Complete the requirements of this assignment on your own. When you have finished, write your name on the board to get your instructor to mark your assignment. You are encouraged to create a flowchart/pseudo code; without that your instructor may not provide any assistance. Step 1: Create a program named CPSC1012-Ex04-YourName Step 2: In the Main() method, write the code that will do the following Ask the user to enter a year (i.e. 2018) Determine if the year entered is a leap year. Use the logic below to determine if a year is a leap year: o If the year is evenly divisible by 4 (i.e. 1980 is a leap year, but 1981 is not) o If the year is evenly divisible by 100, then it must also be evenly divisible by 40o (i.e. 1900 is not a leap year, but 2000 is a leap year) Display whether the year entered is a leap year

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions