Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SSCI 201 - Computer Science 1 Lab assignment 4: Nested FOR. loops and Input/Output with Files Due at 1.00PM, Monday Feb 6 Read sections 5.10,5.11

image text in transcribed
image text in transcribed
SSCI 201 - Computer Science 1 Lab assignment 4: Nested FOR. loops and Input/Output with Files Due at 1.00PM, Monday Feb 6 Read sections 5.10,5.11 and 5.12 of the text as you work on this assignment Objective: Become familiar with designing a solution wing a for loop. Learn hove to croate a nested for loop in Reptor and in Ct+. Note: Qucations I and 2 (pre-lab component) have to be completed Before you come to the lab. IMPORTANT Watch the videes for Locture t and Lncture 2 in Week f of DeL (aaterials content) before you stert on this week's assignments. The sample code for this asignment is available in CourseInfo/Files in CoursoFiles. This week's waigrments doal with files asd neited loops. Input: The program proenpts for the name of an input file and the name of an output file. The input file contalis two poaitive (non-aero) lategers, m and n, each lois than 20, followed by a character. Output A flle coutaining an mn roctangle made uisg the specified character. For example, if the input fle contained the numbers 4 and 6 aad the character as shown below, 46. the output file would show 4 lines of 6 mats each, as abcws below: This program will zart ty openitig the inpot file and wadiag the numbers and the specified diaracter. Thutratur a neted for boup will peactate the patiem. The follosing queatbons are dolarned to krep you through the process of croling the neted boip. Pre-lab component: Question 1: tiang. Ravtice, create a dowchant for the following procese dindad in go to the aest line.) Pre-lab component Quention 2. Ccoled a asted bop in Fisptio. The onter hoop will naw the in Raptor, the outer loop is created first, and the inner loop is placed inside it. Question 3: Implement your algorithm in C++ using the for loops. (See the programs in In CourseInfo/F1les/ in CourseFiles for help with opening files.) Create three sample data files. In a script session, do the following: 1. cat the program file and compile it using g++. 2. For each data file you created, display the file, run the program and display the resulting output file. What to submit. Create a folder named Lab4 in your CourseFiles folder and upload the Raptor flowcharts and your script to this

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions