94.3k views
1 vote
Programming question: • Question: Write a program that takes input as described below and prints output as described below. The program must work with the automated marker. This question is purely for you to obtain familiarity with the automated marker system which will be used more in later assignments. • Input: Input consists of many lines. At the end of each line there is hash symbol #. For example: blah# 45 67# ddgfh fjhg gjkhgk# • Output: Output consists of the same lines as the input but without #. For example, for the input given above the output should be: blah 45 67 ddgfh fjhg gjkhgk • Language: You can use Java, C,C++, PyPy, Python, Go, C#, Rust, F#, Javascript. • Number of attempts: There is a limit of 10 submission attempts for this assignment in order to get full mark. The last submission submitted before the assignment deadline will be the one marked. Beyond 10 submissions, a penalty will apply, but every student who eventually submits a correct answer on time will get 75% for this question. In future assignments, restrictions and penalties may be stronger.

User Tinno TL
by
7.3k points

1 Answer

4 votes

Final answer:

To solve this programming question, write a program to remove the '#' symbol from the input lines and print the output without it.

Step-by-step explanation:

To solve this programming question, you can use any programming language mentioned in the prompt, such as Java, C++, Python, etc. You need to write a program that takes input consisting of multiple lines, with a hash symbol '#' at the end of each line.

The program should remove the '#' symbol and print the output without it.

Here is an example solution in Python:

for line in sys.stdin: if line.endswith('#'): print(line[:-1]) else: print(line)

User Plucury
by
7.4k points