0% found this document useful (0 votes)
31 views2 pages

102 HW 06

This homework assignment has three questions. Question 1 involves writing iterative and recursive functions to remove blanks from a string. Question 2 involves writing a program to pluralize nouns based on certain rules. Question 3 involves reading a 21x21 character array representing a maze from a text file, finding a path from start to finish using recursion, and displaying the solved maze.

Uploaded by

Sinan Nar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views2 pages

102 HW 06

This homework assignment has three questions. Question 1 involves writing iterative and recursive functions to remove blanks from a string. Question 2 involves writing a program to pluralize nouns based on certain rules. Question 3 involves reading a 21x21 character array representing a maze from a text file, finding a path from start to finish using recursion, and displaying the solved maze.

Uploaded by

Sinan Nar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

BIL 102 Computer Programming Homework - 06

Due to May 02 23:59

1) Write and test two functions deblankIterative and

deblankRe ur!ive that takes a string output and a string input argu ent and returns a copy of the input argu ent with a!! "!anks re o#ed$ %Write this function "oth iterati#e and recursi#e as deblankIterative and deblankRe ur!ive&

'his is a sa p!e string$ " 'hisisasa p!estring$

2) Write a progra

that takes nouns and for s their p!ura!s on the "asis of

these ru!es: i) (f noun ends in y) re o#e the y and add ies ii) (f noun ends in s) ch or sh add es iii) (n a!! other cases) *ust add s print each noun and its p!ura!$ 'ry the fo!!owing data: chair dairy "oss circus f!y dog church c!ue dish

#) Write a program that reads a 21 by 21 array of characters from a text file. It

represents a maze. Each position can contain either an X or a blank. The borders of the maze are covered by X! except start and exit points. "ead text file as a character array and find start and finish points on the array borders #it doesn$t matter %hich one is start or finish point& 'ind a path from start point to the finish point. (nly horizontal and vertical moves are allo%ed.#right) left) *p and do%n&. If no path exists) %rite a message indicating there is no path. If there is a path to the exit location) mark the path %ith +(, and display the sol*tion maze on the screen. -oves can be made only to locations that contain a blank. If an X is enco*ntered) that path is blocked and another m*st be chosen. .se rec*rsion. The test mazes are given and example maze is at the second pages/

In t$i! $omework% &ou !$ould !end t$e 'ollowing 'ile!(

+$ ,W-.09+0/000.123'.+$c
,W-.09+0/000.123'.2$c ,W-.09+0/000.123'.3$c

44 5uestion + 44 5uestion 2 44 5uestion 3

x x x x x x x x x x x x x x x x x x x o x

x o o o o o o o o o o o o o o o o o x o x

x o x x x x x x x x x x x x x x x o x o x

x o x o o o o o o o o o o o o o x o x o x

x o x o x x x x x x x x x x x o x o x o x

x o x o x

x o x o x x x x x x o x o x o x o x o x

x o x o x

x o x o x

x o x o x

x o x o x

x o x o x

x o x o x

x o o o x

o o o x o x o x o x

x x x x x x o o x x o o x x o o x x o o x x o o x x

x x x x x x x x o x x o o o o x x x o o o x x x o o o x x x o o x x o x x x x o x x x o x o x

o x o o o x o x

x x x x x

x x x x x x x x x x x o o x o x x o x x o x o o x x x x o o x x o x x o x x o x o o x x x x x x x x

x o x x x x x x x x x x x x x x x x x x x x x x x x x

x x x o x x o x o x o o x o o x o o x o o x o o x o o x o o x o o x o o x o o x o o x o o x o o o o x x

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy