COM1002-COMPUTER PROGRAMMING 2 (Solution)

$ 24.99
Category:

Description

LAB6 Quiz
Assoc. Prof. Dr. Hacer Yalım Keleş

DuraSon: 90 minutes

Write a program that takes a character sequence and an index sequence as inputs and removes the characters in the given indexes with the given order:
Ex: abcdef 2 0 3 -1
Keeping the given character sequence in an array:
[‘a’, ‘b’,’c’,’d’,’e’,’f’]
AGer removing the character at the index 2, the array becomes:
[‘a’, ‘b’,’d’,’e’,’f’]
Then remove the character at the index 0:
[ ‘b’,’d’,’e’,’f’]
Then 3:
[ ‘b’,’d’,’e’]
You are leG with this data. Please print the remaining characters to the output starMng from index 0:
> bde
Input Format:
<character sequence>[Space]{<indexes>[Space]}* -1
{.}* -> zero or more
All the index sequences will be terminated with -1.
Output Format:
<remaining character sequence>
*You can assume that the character sequence will not exceed 100 characters.
Submission: Your source code will be named using your student ID: <student-id>.c Ex: if your id is 1123456 than you should name your source code like this: 1123456.c
Please test your program thoroughly before submission.
Good luck ☺

Reviews

There are no reviews yet.

Be the first to review “COM1002-COMPUTER PROGRAMMING 2 (Solution)”

Your email address will not be published. Required fields are marked *