Prog1 - CSc 252 Program 1 Version 1.0 Program 1 Array...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSc 252 Program 1 Version 1.0 1 of 4 Program 1: Array Practice Program due: Thursday, September 29th, 11:59 p.m. Write a MIPS program named prog1.s .Your program will use an array labeled values . The number of words in the array will be stored in a word labeled numValues . There will be one additional integer provided, named printPositive . Your program will print the integers in the array, one to a line. Then, test the value of printPositive . If printPositive is a 1 , then print the positive integers in the array, one to a line. Examples: Here are two examples. In the first example, the value of printPositive is 0 : .data numValues: .word 12 values: .word 17 .word -50 .word 3 .word -23 .word -60 .word 97 .word 20 .word -82 .word 53 .word 30 .word -17 .word 142 printPositive: .word 0 # Your code goes below this line The result of executing prog1.s with this test case should be: The numbers in the array are: 17 -50 3 -23 -60 97 20 -82 53 30 -17 142 In the second example, the value of printPositive is 1 : .data numValues:
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
CSc 252 Program 1 Version 1.0 2 of 4 .word 12 values: .word 17 .word -50 .word 3 .word -23 .word -60 .word 97 .word 20 .word -82 .word 53 .word 30 .word -17 .word 142 printPositive: .word 1 # Your code goes below this line The result of The result of executing prog1.s with this test case should be: The numbers in the array are: 17 -50 3 -23 -60 97 20 -82 53 30 -17 142 The positive numbers are: 17 3 97 20 53 30 142 Input: We will provide the first part of your program. This allows us to use different values to test your program. The .data section shown in each of the three examples represent what we will provide. We will provide additional test cases that you can use.
Image of page 2
Image of page 3
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