Input 202525 output 82525p be very careful about the

Info icon This preview shows page 2. Sign up to view the full content.

View Full Document Right Arrow Icon
Input: 20:25:25 Output: 8:25:25:p - Be very careful about the input and output format, inputs and outputs are seperated by “:” . Q3 (25 Points) Write a program whose input is a sequence of letters. Your program should only process the letters before the ‘*’ character and also obey the following conditions: Uppercase letters will be converted to lowercase before being printed on the screen. The output will have the form of a rectangle, whose width is specified by the user. If the number of letters printed are not enough to form the rectangle, the remaining parts will be filled with 0’s (i.e. zeros). Input: 4:absDfgHjKLx*qnMY Output: absd fghj klx0 Input: 3:aQTybNFdGHJklzD* Output: aqt ybn fdg hjk lzd Input: 6:QnmFHjkXcdFEz* Output: qnmfhj kxcdfe z00000 Q4 (25 points) Write a program that prints out a square composed of a character given by the user as ch and whose side is given by the user as X . The frame of the square will be filled by the ch character. Also the left bottom half of the square will also be filled with the ch character (excluding the top left to bottom right diagonal line). Input: 4-h Output: hhhh h h hh h hhhh Input: 7-2 Output: 2222222 2 2 22 2 222 2 2222 2 22222 2 2222222 Input: 5-* Output: ***** * * ** * *** * *****
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern