P5 Loop1 Write Programs Using Looping To Print The Following

P5 Loop1 Write Programs Using Looping To Print The Following Pattern

P5: Loop 1. Write programs using looping to print the following patterns: Your program ask the user to enter the size of a pattern from keyboard. NOTE that you will earn extra points if you work on rectangular patters instead of square patterns. See some samples here (1) A square of zeros of any size; Enter the size of the square: Press any key to continue . . . (2) A square of zeros of any size with 1's on the first diagonal; Enter the size of the square: Press any key to continue . . . (3) A square of zeros of any size with 1's on the second diagonal; Enter the size of the square: Press any key to continue . . . (4) A square of zeros of any size with 1's on both diagonals; Enter the size of the square: Press any key to continue . . . (5) A rectangular flag.

Enter the width and height of a rectangle: 20 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Enter the width and height of a rectangle: 30 10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Paper For Above instruction

Write a program using loops to print out counting numbers in a triangle pattern with the height chosen by the user (the height

Additionally, create a program to analyze a data file containing integers. The program should read all integers to find the largest and second-largest numbers as well as compute their sum. The algorithm for finding the second largest involves initializing both largest and second-largest with the first read number; then, reading subsequent numbers and updating these values based on comparisons to ensure the correct second-largest number is captured.

Ensure your code includes necessary comments at the top indicating your name, class, assignment name, and date. Format your code properly with indentation and spacing for readability. Save all code and output into a single text file named in the format P5_YourName.txt and submit via Blackboard before the deadline. Late submissions will not be accepted.