Question

Lab 3 – Pseudocode and Parallel Arrays This lab requires you to think about the steps...

Lab 3 – Pseudocode and Parallel Arrays

This lab requires you to think about the steps that take place in a program by writing pseudocode. Read the following program prior to completing the lab.

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, so on. Assume that the year is not a leap year.) Also, use a parallel array to store the month names. Display 12 sentences in the same format; for example, the first sentence is January has 31 days..

For the programming problem, create the pseudocode and enter it below.

Enter pseudocode here

Homework Answers

Answer #1

Kindly upvote if this helped

Pseudo-code


days []
= {31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31};
months [] = {"January" , "Febuary" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December"};
i = 0;
for i <- 12
print ( months [i] +" has "+days[i]+" days" );
i++;
end loop


OUTPUT





Corresponding java code for better understanding:

public class Months {
public static void main(String[] args) {
        int days [] = {31 , 28 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31};
        String months [] = {"January" , "Febuary" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December"};
        for(int i=0;i<=11;i++) {
                System.out.println(months[i]+" has "+days[i]+" days");
        }
}
}




Know the answer?
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
Similar Questions
Step 3: Complete the following chart by writing what the counter and the totalNumbers value stores...
Step 3: Complete the following chart by writing what the counter and the totalNumbers value stores on each iteration of the loop. Counter totalNumbers 0 34 1 73 2 98 3 116 4 159 5 190 6 202 Lab 2 – Pseudocode and Arrays This lab requires you to think about the steps that take place in a program by writing pseudocode. Read the following program prior to completing the lab. Design the logic for a program that allows a...
Find the Month and Day. Working with 2 parallel arrays. One holds the months of the...
Find the Month and Day. Working with 2 parallel arrays. One holds the months of the years, the other array holds the # of days in each month. This lab will determine what Month and DayOfMonth for any given day of the year. 1). Name the lab "Lab4_MonthAndDay". Remember, case sensistive. 2). Ask user to input a # between 1 and 365. Validate the input. 3). Also ask user to input the year, between year 1 and year 202. Validate...
Q: Design a program that lets the user enter the total rainfall for each of 12...
Q: Design a program that lets the user enter the total rainfall for each of 12 months into an array. The program should calculate and display the total rainfall for the year, the average monthly rainfall, and the months with the highest and lowest amounts. Create parallel arrays for the month names and rainfall amounts for each month. Use month names (i.e. January, February, March, etc.) when printing out the months with the highest and lowest amounts. Include a modular...
Phone number lookup Design a program that has two parallel arrays: a string array named people...
Phone number lookup Design a program that has two parallel arrays: a string array named people that is initialized with the names of seven of your friends, and a string array named phoneNumbers that is initialized with your friends phone numbers. The program should allow the user to enter a persons name (or part of a persons name). it should then search for that person in the people array. If the person is found, it should get that persons phjone...
Leap Year The month of February normally has 28 days. But if it is a leap...
Leap Year The month of February normally has 28 days. But if it is a leap year, February has 29 days. Write a program that asks the user to enter a year. The program should then display the number of days in February that year. Use the following criteria to identify leap years: Determine whether the year is divisible by 100. If it is, then it is a leap year if and if only it is also divisible by 400....
n this lab, you use what you have learned about parallel arrays to complete a partially...
n this lab, you use what you have learned about parallel arrays to complete a partially completed C++ program. The program should: Either print the name and price for a coffee add-in from the Jumpin’ Jive Coffee Shop Or it should print the message Sorry, we do not carry that. Read the problem description carefully before you begin. The file provided for this lab includes the necessary variable declarations and input statements. You need to write the part of the...
Create a Java Program/Class named MonthNames that will display the Month names using an array. 1....
Create a Java Program/Class named MonthNames that will display the Month names using an array. 1. Create an array of string named MONTHS and assign it the values "January - December". All 12 months need to be in the array with the first element being "January", then "February", etc. 2. Using a loop, prompt me to enter an int variable of 1-12 to display the Month of the Year. Once you have the value, the program needs to adjust the...
Create a Java Program/Class named MonthNames that will display the Month names using an array. 1....
Create a Java Program/Class named MonthNames that will display the Month names using an array. 1. Create an array of string named MONTHS and assign it the values "January" through "December". All 12 months need to be in the array with the first element being "January", then "February", etc. 2. Using a loop, prompt me to enter an int variable of 1-12 to display the Month of the Year. Once you have the value, the program needs to adjust the...
PLEASE USING C# TO SOLVE THIS PROBLEM. THANK YOU SO MUCH! a. Create a project with...
PLEASE USING C# TO SOLVE THIS PROBLEM. THANK YOU SO MUCH! a. Create a project with a Program class and write the following two methods (headers provided) as described below: - A Method, public static int InputValue(int min, int max), to input an integer number that is between (inclusive) the range of a lower bound and an upper bound. The method should accept the lower bound and the upper bound as two parameters and allow users to re-enter the number...
Objective The Final Project aims to demonstrate your ability to analyze data from a big database,...
Objective The Final Project aims to demonstrate your ability to analyze data from a big database, exercise use of arrays of objects, external classes, processing files and user interaction. For this project, you will design and implement a program that analyzes baby name popularities in data provided by the Social Security Administration. Every 10 years, the data gives the 1,000 most popular boy and girl names for kids born in the United States. The data can be boiled down to...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT