Write a program to perform unsigned binary eight-bit

Assignment Help Programming Languages
Reference no: EM131321759

Program 1: write a program that asks user to enter a year and this program checks whether that year is leap year or not. Also it should print out all a calendar for the year entered. Starting on Monday Jan 1st, 1900. Characteristic of a leap year: • It has 366 days. • February has 29 days. • February starts and ends on the same day. • January, April, and July, all start on the same day of the week. Definition: • A leap year can always be evenly divided by 4. For example, 2012 was a leap year. • But a year is not a leap year if it can be evenly divided by 100 but cannot also be evenly divided by 400. This is why 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not. • A leap year can always be evenly divided by 4. • Century years must also be divisible by 400. Pseudo code algorithm: if year is divisible by 4 then if year is divisible by 100 then if year is divisible by 400 then IS_leap_year else NOT_leap_year else IS_leap_year else NOT_leap_year Let D4 = year divisible by 4 D100 = year divisible by 100 D400 = year divisible by 400 From the definition: D4 Λ (D100 → D400) ⇔ D4 Λ (¬D100 V D400) ⇔ (D4 Λ ¬D100) V (D4 Λ D400) ⇔ (D4 Λ ¬D100) V (D400) ⇔ D400 V (D4 Λ ¬D100) ⇔ D400 V (¬D100 Λ D4) or D4 Λ (¬D100 V (D100 Λ D400)) ⇔ (D4 Λ ¬D100) V (D4 Λ D100 Λ D400) ⇔ (D4 Λ ¬D100) V (D400) ⇔ D400 V (¬D100 Λ D4) IS_leap_year = D400 V (¬D100 Λ D4)

2. Write a program to perform unsigned binary 8-bit to decimal conversion and decimal to binary conversion.

Reference no: EM131321759

Questions Cloud

Approaches the earth with a speed : Spacecraft I, containing students taking a physics exam, approaches the Earth with a speed of 0.700c (relative to the Earth), while spacecraft II, containing professors proctoring the exam, moves at 0.300c (relative to the Earth) directly toward t..
Analyze the aspect of human culture you selected for each : Anthropologists are interested in framing broad hypotheses about human behavior. In order to do this, it is imperative to use examples from multiple cultures to ensure that their conclusions are not grounded in a single case.
What are linear relationship and a curvilinear relationship : When are correlational research designs used in behavioral research? What are their advantages and disadvantages?
Discuss differences between a firewall and a packet filter : Show how data protocols such as TCP, UDP, and ICMP can be implemented in a firewall and give the type of firewall best suited for each of these protocols.
Write a program to perform unsigned binary eight-bit : Write a program to perform unsigned binary 8-bit to decimal conversion and decimal to binary conversion. Write a program that asks user to enter a year and this program checks whether that year is leap year or not.
How these enhancements are achieved : Kerberos and SSL are additional layers to enhance authentication. Detail how these enhancements are achieved in both cases.
How much value does the use of debt add : Under the MM extension with growth, what is the value of your firm's tax shield, i.e., how much value does the use of debt add?
Examine how and why migration is increasing globally : Globalization has caused extensive shifts in the mobility of people between countries. Economics, political shifts, and increased opportunities for travel have made migration and immigration pervasive. This assignment will explore immigration patt..
Is the role of pki in authentication exaggerated : Discuss the bene fits of enhancement of basic authentication with a cryptographic scheme such as Kerberos, SSL, and others. Give specific examples.

Reviews

Write a Review

Programming Languages Questions & Answers

  Simulate the metro station

To simulate the metro system, your program will create and manipulate a set of dynamic data structures that will represent various components of the metro. Figure 1 illustrates the required dynamic data structures. Your program will maintain 3 typ..

  Describe at least one feature of object-oriented programming

Describe at least one feature of object-oriented programming that Visual Logic lacks. Identify at least one advantage to using event-driven programming, as compared to using purely procedural programming.

  Implement sumpairs and sumof

Using SML writes a version of sumPairs that sums each component of the pairs separately, returning a pair consisting of the sumof the first components and the sum of the second components

  Simulate the recursive factorial function given in the class

In this programming assignment, you are asked to simulate the recursive factorial function given in the class. Your program is to be a nonrecursive version of the factorial function implemented using a stack.

  Write a program that reads an initial investment balance

Write a program that reads an initial investment balance and an interest rate. Then print the number of years it takes for the investment to reach one million dollars.

  Write a function that accepts temperature in degrees

write a function that accepts temperature in degrees fahrenheit degf andcomputes the corresponding value in degrees

  Explaining class with no constructors

How many constructors can a class have? Can you have a class with no constructors? If a class has more than one constructor, which of them gets called?

  Write program which asks user for names

Write down a program which asks user for names (Prompt user with something like "Enter a name, or q when finished"), assigns new Person (in heap memory) for each of them.

  Crossing a canyon on a cable bridge

Construct a Prolog program using in-depth research to find a solution to this problem. It must compile with no errors and follow the directions.

  Describe two other techniques for validating your document

This week covered validation and the use of validators. Describe at least two other techniques for validating your document that does not involve submitting it through an online validator.

  Design application to declare an array

Design an application that declares an array of 10 HousePlants. Prompt the user user for data for each of the HousePlants, then display all the values.

  Create a multi-threaded competition

Create a multi-threaded competition

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd