Question

R$ ( pseudocode only, I just need the English written pseudocode) Write pseudocode for a program...

R$ ( pseudocode only, I just need the English written pseudocode)

Write pseudocode for a program that prints a calendar such as the following:

Su  M  T  W Th  F Sa
          1  2  3  4
 5  6  7  8  9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

Pseudocode :

getWeekDay(day, month, year)

/* This method returns the day of the week for a particular date, where divisions of weekdays are Sunday = 0, Monday = 1, Tuesday = 2, etc. and day, month and year are the actual dates */

1) A = (14 - month) / 12

2) Y = year - A

3) M = month + 12 * A - 2

4) return remainder of (day + Y + Y / 4 - Y / 100 + Y / 400 + (31 * M) / 12) / 7

main()

/* The main method that drives the calendar program */

1) names = January, February, March, April, May, June, July, August, September, October, November, December

2) Take year input from user

3) startingDay = getWeekDay(1, 1, year)

4) months = 31, 28, 31, 30, 31, 30, 31, 31 30, 31, 30, 31

5) if remainder of year / 400 = 0 or (remainder of year / 4 = 0 and remainder of year / 100 not equals to 0)

i) months = 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31

6) loop from month = 0 until month < 12 and incrementing month = month + 1

i) daysInMonth = months.month

ii) print newline + blank spaces + names.month + blank spaces + newline

iii) print newline + Su M T W Th F Sa + newline

iv) loop from dayOfWeek = 0 until dayOfWeek < startingDay and incrementing dayOfWeek = dayOfWeek + 1

I) print blank spaces

v) loop from date = 1 until date <= daysInMonth and incrementing date = date + 1

I) print date

II) if incrementing dayOfWeek = dayOfWeek + 1 > 6

#) print newline

#) dayOfWeek = 0

vi) if dayOfWeek not equals to 0

I) print newline

vii) startingDay = dayOfWeek

7) return and exit

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
R$ ( pseudocode only, I just need the English written pseudocode) Write pseudocode for a program...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Task 2 Write a shell script program call cal3.sh to do the following. 1. Print the...

    Task 2 Write a shell script program call cal3.sh to do the following. 1. Print the output "you must provide at least one month" when there is no argument 2. Print the calendar with specified month matching the argument when there is one argument $ ./cal3.sh 1 January 2016 Su Mo Tu We Th Fr Sa 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 25 26 27...

  • Assembly Language Programming Assignment program must be in: MASM assembly language / x86 architecture / irvine...

    Assembly Language Programming Assignment program must be in: MASM assembly language / x86 architecture / irvine library procedures Objectives: 1. using register indirect addressing 2. passing parameters 3. generating “random” numbers 4. working with arrays Description: Write and test a MASM program to perform the following tasks: 1. Introduce the program. 2. Generate ARRAYSIZE random integers in the range [LO = 10 .. HI = 29], storing them in consecutive elements of an array. ARRAYSIZE should be set to 200....

  • Write a program that, given a month and year, prints a calendar, such as June 2016...

    Write a program that, given a month and year, prints a calendar, such as June 2016 Su Mo Tu We Th Fr Sa 5 6 7 8 910 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 To find out the weekday of the first day of the month, call this function: Computes the weekday of a given date. @param year the year @param month the month (1=January 12=...

  • A soft drink manufacturer uses fire agents to handle premium distribution for is various products. The marketing director desired to study the timeliness with which the premiums are distributed. Twent...

    A soft drink manufacturer uses fire agents to handle premium distribution for is various products. The marketing director desired to study the timeliness with which the premiums are distributed. Twenty transactions for each agent were selected at random and the time lapse (in days) for handling each transaction was determined. The results follow: Agent 1 Agent 2 Agent 3 Agent 4 Agent 5 24 18 10 15 33 24 20 11 13 22 29 20 8 18 28 20 24...

  • Need help writing a program that meets pseudocode and criteria . Txt File below input.txt file...

    Need help writing a program that meets pseudocode and criteria . Txt File below input.txt file data 05 11/30/16 03 12/07/16 05 12/07/16 05 12/08/16 01 12/10/16 07 12/11/16 07 12/14/16 06 12/15/16 02 12/21/16 05 12/21/16 06 12/22/16 07 12/22/16 08 12/23/16 07 12/23/16 07 12/23/16 07 12/23/16 08 12/24/16 08 12/24/16 07 12/24/16 03 12/26/16 05 12/26/16 07 12/28/16 04 12/29/16 07 01/01/17 06 01/03/17 07 01/03/17 08 01/05/17 05 01/10/17 04 01/17/17 08 01/17/17 07 01/18/17 07...

  • I know how to do number one just not number 2. Please answer number 2 only...

    I know how to do number one just not number 2. Please answer number 2 only Write a java program that will print out following pattern. Use nested for loop. 2. Add a method to the above program that generates takes two numbers as parameters and prints out all the numbers from number 1 to number 2 separated by using a while loop. (Do not print the last ,'). For example: Calling method1(9,51) should print: 9, 10, 11, 12, 13,...

  • In C++ Make a program that takes a positive integer 'n' and write an n x...

    In C++ Make a program that takes a positive integer 'n' and write an n x n matrix whose entries are listed as snail Example: (See picture) for n=6 Ej. Para n-6 2 2 2 20 21 22 23 24 7 19 32 33 34 258 18 31 36 35 26 9 17 30 29 28 27 10 16 15 14 13 12 11

  • After discussing the issue with you and others in the Finance department, the manager decided to...

    After discussing the issue with you and others in the Finance department, the manager decided to change the payment terms for Accounts Receivable. The payment time remained at 14 days, but the penalty for late payments was increased. After about 3 months under the new payment terms, you asked the manager to collect a second stratified random sample. The data is presented in the second column of the worksheet (see the tab titled, “Data – Case #2) under the Heading...

  • Therefore, for this program you will read the data in the file named weatherdata_2.txt into arrays...

    Therefore, for this program you will read the data in the file named weatherdata_2.txt into arrays for the wind speed and for the temperature. You will then use the stored data to calculate and output the average wind speed and the average temperature. Create a constant with a value of 30 and use that to declare and loop through your arrays and as a divisor to produce your averages. Here is the data file (below). 1. 14 25 2. 12...

  • 1 A measurement systems experiment involving 20 parts, three operators, and two measurements per ...

    1 A measurement systems experiment involving 20 parts, three operators, and two measurements per part is shown in Table 8E. 12. (a) Estimate the repeatability and reproducibility of the gauge (b) What is the estimate of total gauge variability? (c) If the product specifications are at LSL 6 and USIL - 60, what ca you say about gauge capa bility? TABLE 8E. 12 Measurement Data for Exercise 8.34 Operator 1 Operator 2 Operator 3 Measurements Measurements Measurements Part Number 1...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT