Write a program that performs boolean expressions

Assignment Help Basic Computer Science
Reference no: EM13781409

Write a program that performs the following tasks

1) Read in a month and determine the number of days in the month. If the month is February, prompt the user for a year and determine if the year is a leap year to output the correct number of days. (A leap year is divisible by four, except for years with are multiples of 100, which are only leap years if they are also divisible by 400). Your program should accept the month as a 1 or 2 digit number, a three letter abbreviation for the month, or a full month.

2) Given someone's brithday in the form mm/dd, m/dd, mm/d or m/d generates their sign and random advice (from atleast four possibilities).

3) Write the truth tables for the following boolean expressions:

a. A || B && C
b. (A || B) && ! (A && B)

4) Strictly extra credit: Write a compatibility test for an online dating service.

a. Have the two people enter their names.
b. Calculate points as follows:
i.If the two names are the same, they get -1 points and you do not have to check anymore
ii.If the names of the same length add 2 points if the length of one name is 1 more than the other add one point
iii.If the first letters are the same add 1 point
iv.If the last letters are the same add 1 point
v.If the last letter of one name is the same as the first letter of the other add 1 point. (do the same for both names)
vi.Add the int values of the first letter of each name. take the value mod 3 and add it to the total.
vii.Add the int values of the second letter of each name. take the value mod 4 and add it to the total.
c. You should have anywhere from -1 to 11 points. Print off the points and a snarky comment appropriate for each one. Be sure to include their names in the message. Use this list to determine which comment to display:
i.11 points à comment 1
ii.8 to 10 points à comment 2
iii.5 to 7 points à comment 3
iv.2 to 4 ponts à comment 4
v.0 or 1 points à comment 5
vi.-1 points à comment 6
Sample test runs on the next two pages

Reference no: EM13781409

Questions Cloud

Professional public relations practice throughout the world : The need for professional public relations practice throughout the world is increasingly obvious, and those who are now studying public relations in colleges and universities will practice public relations at a time in history when public relations w..
Health policy-overview of theoretical and practical support : Introduce the topic of your proposed new health policy. Include your problem statement and describe the background behind the problem. Show the reader why this issue is important, the rationale as to why the new policy is needed, and what you intend ..
Describe the types of cost-based pricing : Name and describe the types of costs marketers must consider when setting prices. Describe the types of cost-based pricing and the methods of implementing both. Provide examples and a breakeven analysis for a product you are familiar with. If possibl..
Marketing department of a high-end department : Assume you work in a marketing department of a high-end department store. You send out Thank You cards with a short customer satisfaction survey one week after purchase. You wonder if survey response rates would increase significantly from your curre..
Write a program that performs boolean expressions : Read in a month and determine the number of days in the month. If the month is February, prompt the user for a year and determine if the year is a leap year to output the correct number of days.
Write the program vb text as a model : the VB text as a model and write the program so that each group is invisible and becomes visible only when its corresponding check box is checked. After the button is clicked, the amount of the bill should be calculated. NOTE: FIGURE 4.62 IS A DIF..
Verify the correctness of the board content : The mission of this assignment is to implement a "Sudoku game board" and interact with user using a small set of commands that enable to initialize the game board. You program must permit user to see the game board, swap rows,
Create an interface that has two list boxes : Create an interface that has 2 list boxes for i) the weekly hours worked (containing integer values from 35 to 45 inclusive) and ii) the hourly rate of pay (from 9.50 to 14.00 inclusive, in increments of 0.50).
Development and characteristics of abstract expressionism : Discuss the development and characteristics of Abstract Expressionism; be sure to include Gorky, Pollock, and de Kooning in your discussion, using examples of their work as discussed in the text.

Reviews

Write a Review

 

Basic Computer Science Questions & Answers

  Change arp entry in computer for mac address

Print your ARP cache table. Find a server on your local network. Change its ARP entry in your computer to point to your computer's MAC address. Print new ARP cache table. Now use the service and see what happens.

  Compare swing java gui components to awt components

Compare Swing Java GUI components to AWT components. Explain at least one way the components are similar and at least one way they are different. Provide examples to support your rationale.

  Explaining notifier sends e-mail to system administrator

Suppose a notifier sends e-mail to the system administrator when a successful compromise of that system is detected. What are the drawbacks of this approach?

  Create a change - counting game

create a change - counting game that gets the user to enter the number of coins required to make exactly one dollar. the program should let the user enter the number of pennies,nickels,dimes, and quarters.

  Write a java program that produces a simple formatted report

For this lab you will write a Java program that produces a simple formatted report. The program will prompt the user to enter a file name. This file must contain information in a specific format (detailed below).

  Use the raptor to complete the problem

Use the Raptor to complete the problem, Input names of students from the user, terminated by "ZZZ", 0, 0, 0, and create a data file grades with records of the following form: student (string), test (integer), test 2 (integer), test 3 (integer)

  What exactly active directory folders purposes

Active Directory folders (not shared folders) are unique objects in Active Directory.

  Introduction to website development

In this course, you will be creating a 3-page Web site using HTML5 and CSS3. The content of the Web site is your choice. The elements that must be included are a home page (index.html) and two other pages.

  Write a program that generates a random integer

Write a program that generates a random integer in the (inclusive) range [0-9] (i.e. the set {0,1,2,3,4,5,6,7,8,9}) and ask the user to guess what the number is .

  Write a condition to test

write a condition to test if the point is outside the rectangle. Assume that x increases to the right and that y increases to the top.

  Find the distance from the point

find the distance from the point (1 2 3) from each of the following 1) the line of intersection of the plane p1 x-2y-3z=4 and p2 ; 2x-y +5z=1 2) the plane perpendicular to the ( X+2)/3= (Y-1)/-2 = (Z-3)/-1

  Calculate the cost and schedule variances

Calculate the cost and schedule variances and indexes for Tasks A, B, C, D, and E.(b) As project manager, write a brief summary of the status of the project at this time.

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