Days of Each Month
Design a
January has 31 days.
February has 28 days.
March has 31 days.
April has 30 days.
May has 31 days.
June has 30 days.
July has 31 days.
August has 31 days.
September has 30 days.
October has 31 days.
November has 30 days.
December has 31 days.
The program should have two parallel arrays: a 12-element String array that is initialized with the names of the months, and a 12-element Integer array that is initialized with the number of days in each month. To produce the output specified, use a loop to step through the arrays getting the name of a month and the number of days in that month.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out with Programming Logic and Design (4th Edition)
Additional Engineering Textbook Solutions
Starting Out with Python (3rd Edition)
Starting out with Visual C# (4th Edition)
Starting Out with Java: Early Objects (6th Edition)
Modern Database Management
Software Engineering (10th Edition)
- (Electrical eng.) a. An engineer has constructed a two-dimensional array of real numbers with three rows and five columns. This array currently contains test voltages of an amplifier. Write a C++ program that interactively inputs 15 array values, and then determines the total number of voltages in these ranges: less than 60, greater than or equal to 60 and less than 70, greater than or equal to 70 and less than 80, greater than or equal to 80 and less than 90, and greater than or equal to 90. b. Entering 15 voltages each time the program written for Exercise 7a runs is cumbersome. What method could be used for initializing the array during the testing phase? c. How might the program you wrote for Exercise 7a be modified to include the case of no voltage being present? That is, what voltage could be used to indicate an invalid voltage, and how would your program have to be modified to exclude counting such a voltage?arrow_forwardpython - final discounted pricearrow_forwardQI/Write a program which asks the user whether if he wants to assign the elements of the first quarter of an 2 dimensional array (4x4) to the third quarter of this array and the elements of the third Quarter to the elements of the first quarter, If user enters "Y" or "y" the program should assign the elements. If "n" or “N" is opted the program should "quit". However, if any other alphanumeric input is given to program program shall display that the particular “input is not recognized". the pre ofarrow_forward
- C program. Thank youarrow_forwardIn visual basic Write a For…Next loop that will printout each value in the array from problem 4.arrow_forwardBookworm boolkstores announced a competition running over four weeks for their three branches. The branch with the highest sales per week will receive a surprise for that week. programmer are requested to write a program to keep record of the number of books sold per week in each of the three branches over this period of four weeks. The (incomplete) program below inputs the respective number of books sold and stores it in a two-dimensional array called sales, with four rows and three columns. The program then displays for each week, the highest number of books sold. You as a Here is an example of the input data for the program: Bookworm Bookworm Bookworm South West North Week I Week 2 Week 3 Week 4 T00 120 T22 TUI 103 96 T19 106 99 102 And the corresponding output: The highest sales in week 1 were 120 books. The highest sales in week 2 were 122 books. The highest sales in week 3 were 119 books The highest sales in week 4 were 106 books. Use the declarations in the (incomplete) program…arrow_forward
- Use C++ programarrow_forwardUSE PYTHON A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Stores this information in a two dimensional 3 × 7 array, where each row represents a different monkey and each column represents a different day of the week. First let the user input the data for each monkey then it should create a report that includes the following information: =>Average amount of food eaten by each monkey for the whole week. =>The least amount of food eaten during the week by any one monkey. =>The greatest amount of food eaten during the week by any one monkey.arrow_forwardQuestion 1Write the pseudocode for the following scenario. The final exam marks for 10 studentsare 65, 45, 78, 65, 89, 65, 79, 67, 75, and 63. The marks are stored in an array. Find:• The student with the highest mark.• The student with the lowest mark.• The total marks for all the students.• The overall average. Question 2 Write the pseudocode for the following statement:The program is to input an examination mark and test it for the award of a grade. Themark is a whole number between 1 and 100.The program will receive the grade from theuser until the number of entered students is equal to 10 and this should now generate areport for all the grade entered with the award description. Grades are awardedaccording to the following criteria:>= 80 Distinction>= 60 Merit>= 40 Pass< 40 failarrow_forward
- 1. initialise a variable named max and set its value equal to first item of array. 2. start a for loop to iterate through every element of marks array. 3. check if item> max. 4. if 4 is true: set max = item, else continue 5. after the loop will finish, max variable will have maximum marksarrow_forwardTranscribed Image Text Given an array arr[] = {1,2,3,4,5,6,7,8,9,10}. Write a program to rotate the array 2 positions to right and print the array.arrow_forwardIn C program Given two arrays: the first one having all the scores and the second being the test numbers that matter, find the sum of the scores of the tests that matter. Input The first line contains the number of scores; The second line contains the scores; The third line contains the number of tests that matter; The fourth line contains the tests that matter. 9 45 15 40 43 50 16 25 30 19 3 1 2 9 Output The sum of the scores that matter. 79arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning