Section 1

.pdf

School

Southern New Hampshire University *

*We aren’t endorsed by this school

Course

140 - X625

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

1

Uploaded by DeaconCaterpillar4154

Report
1.10 zyLab training: Interleaved input / output This section has been set as optional by your instructor. Auto-graded programming assignments have numerous advantages, but have some challenges too. Students commonly struggle with realizing that example input / output provided in an assignment's speci±cation interleaves input and output, but the program should only output the output parts . If a program should double its input, an instructor might provide this example: Enter x: 5 x doubled is: 10 Students often incorrectly create a program that outputs the 5. Instead, the program should only output the output parts: Enter x: x doubled is: 10 The instructor's example is showing both the output of the program, AND the user's input to that program, assuming the program is developed in an environment where a user is interacting with a program. But the program itself doesn't output the 5 (or the newline following the 5, which occurs when the user types 5 and presses enter). Also, if the instructor con±gured the test cases to observe whitespace, then according to the above example, the program should output a newline after Enter x: (and possibly after the 10, if the instructor's test case expects that). The program below incorrectly echoes the user's input to the output. 1. Try submitting it for grading (click "Submit mode", then "Submit for grading"). Notice that the test cases fail. The ±rst test case's highlighting indicates that output 3 and newline were not expected. In the second test case, the -5 and newline were not expected. 2. Remove the code that echoes the user's input back to the output, and submit again. Now the test cases should all pass. 553398.3976864.qx3zqy7 LAB ACTIVITY 1.10.1: zyLab training: Interleaved input / output 2 / 2 Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the ±rst box, then click Run program and observe the program's output in the second box. Enter program input (optional) 5 Input (from above) main.py (Your program) Output (shown below) Program output displayed here Coding trail of your work Instructor note: Reminder: This lab is ungraded. main.py Loading latest submission... Develop mode Submit mode Run program What is this? Retrieving signature Feedback? 1
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help