Question
Just pasty b
Use parallel arrays and use simple puedocode

13. a. Design an application in which the number of days for each month in the year is stored in an array. (For example, January has 31 days, February has 28, and so on. me that the year is not a leap year) Display 12 sentences in same format for the each month; for example, the sentence displayed for January is Month 1 has 31 days b. Modify the months and days program to contain a parallel array that stores month names. Display 12 sentences in the same format; for example, the first sentence is Ianuary has 31 days.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer A:-

pseudocode:-

int day[]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

Display “January is Month 1 has” day [0] “days”

Display “February is Month 2 has” day [1] “days”

Display “March is Month 3 has” day [2] “days”

Display “April is Month 4 has” day [3] “days”

Display “May is Month 5 has” day [4] “days”

Display “June is Month 6 has” day [5] “days”

Display “July is Month 7 has” day [6] “days”

Display “August is Month 8 has” day [7] “days”

Display “September is Month 9 has” day [8] “days”

Display “October is Month 10 has” day [9] “days”

Display “November is Month 11 has” day [10] “days”

Display “December is Month 12 has” day [11] “days”

-----------------------------------------------------------------------------------------------------

Answer B

pseudocode is:-

// using parallel array

String monthName[]= {“January”, “February”, “March”, “April”, “May”, “June”, “July”, “August”, “September”, “October”, “November”, “December”}
int day[]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

For i=0 to 12 do

        Display      monthName[] “has” day[0] “days”

End of For loop

---------------------------------------------------------------------------------------------

If you have any query, please feel free to ask.

Thanks a lot.

Add a comment
Know the answer?
Add Answer to:
Just pasty b Use parallel arrays and use simple puedocode 13. a. Design an application in...
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
  • JAVA CODE Beginner. please use if, else if or switch statements, but don't use arrays, please  ...

    JAVA CODE Beginner. please use if, else if or switch statements, but don't use arrays, please   Write a program that reads a string from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format mm/dd/yyyy. A valid month value mm must be from 1 to 12...

  • PLEASE USE PSEUDOCODE Input a list of employee names and salaries stored in parallel arrays. The...

    PLEASE USE PSEUDOCODE Input a list of employee names and salaries stored in parallel arrays. The salaries should be floating point numbers in increments of 1000 (note: the book says 100, but it is wrong). For example, a salary of $36,000 should be input as 36.0 and a salary of $85,900 should be input as 85.9. Find the mean (average) salary without using any Python sum or average functions and display the names and salaries of employees who earn within...

  • In Java. Write a GUI contact list application. The program should allow you to input names...

    In Java. Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...

  • Write a C++ console application that allows your user to capture rainfall statistics. Your program should...

    Write a C++ console application that allows your user to capture rainfall statistics. Your program should contain an array of 12 doubles for the rainfall values as well as a parallel array containing the names of the months. Using each of the month names, prompt your user for the total rainfall for that month. The program should validate user input by guarding against rainfall values that are less than zero. After all 12 entries have been made, the program should...

  • PART B: DATE BOOK A classic computer application is the electronic date book: a list of...

    PART B: DATE BOOK A classic computer application is the electronic date book: a list of daily events stored in a calendar. Write a Java program that can be used as a simple date book. The date book will use a separate array for each month of the year, with one array entry for each day in the month (0 = first day of the month, 1 = second day of the month, etc.). The date book is "simple" because...

  • In the following program, declare an integer array daysInMonth that stores the number of days in January, February, March, April, and so on

    # JAVA In the following program, declare an integer array daysInMonth that stores the number of days in January, February, March, April, and so on. Fill it with the appropriate values (31, 28, 31, 30, ...).The program reads a month and year from the user.When the year is a leap year, change the entry for February to 29.Print out how many days the given month has.CODE:import java.util.Scanner;public class NumberOfDays{   public static void main(String[] args)   {      // Declare and initialize daysOfMonth      ....

  • Write a Java console application that reads a string from the keyboard and tests whether it...

    Write a Java console application that reads a string from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is NOT valid. The input date will have the format mm/dd/yyyy. A valid month value mm must be from 1 to 12 (January is 1). You can use: String monthPart = inputDate.substring(0, 2); int month =...

  • Question 1: Write a program in C that reads a date from the keyboard and tests...

    Question 1: Write a program in C that reads a date from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format: mm/dd/yyyy Note that there is no space in the above format. A date in this format must be entered in one line. A valid...

  • C Program Question 1: Write a program that reads a date from the keyboard and tests...

    C Program Question 1: Write a program that reads a date from the keyboard and tests whether it contains a valid date. Display the date and a message that indicates whether it is valid. If it is not valid, also display a message explaining why it is not valid. The input date will have the format: mm/dd/yyyy Note that there is no space in the above format. A date in this format must be entered in one line. A valid...

  • Exercise Five: (Parallel Array) In this exercise create two string arrays. One array will hold your...

    Exercise Five: (Parallel Array) In this exercise create two string arrays. One array will hold your name, another will hold corresponding password. Example: string name [] = {"name1","name2", "name3"}; string password [] = {"password1", "password2", "password3"}; Here for name1, matching password is password1, name2, matching password is password2 and so on.... Please ignore my creativity, you can pick name and password your way and it doesn't have to have just 3 names and password. It can be less/more. I am...

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