[SOLVED] COM1002 Lab 6

30.00 $

Category: Tags: ,
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Lab-6-oismo5.zip (47.7 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
Rate this product

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>\n

*You can assume that the character sequence will not exceed 100 characters. *Invalid indexes may be specified as well. You need to check if it is in the data range.

  • Lab-6-oismo5.zip