Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

6 Problems in Midterm Exam - Object Oriented Programming | 547 202, Exams of Information Technology

Material Type: Exam; Class: 547 - OBJECT-ORIENTED PROG; Subject: INFORMATION TECHNOLOGY AND INFORMATICS; University: Rutgers University; Term: Unknown 1989;

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-zra
koofers-user-zra 🇺🇸

5

(1)

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
04:547:202 – Object-Oriented Programming
Midterm exam
Problems
Imagine that you are part of a team working on a project to develop an interactive help
system. Below are the requirements that you need to implement.
1. Invite the user to describe their problem. Read the user’s sentence and display
each distinct word in the user’s input. Ignore differences in capitalization. (You
may want to re-use the InputReader class from one of the projects discussed.)
2. Display the words from the user’s sentence in alphabetical order. (You may want
to use a set that orders items automatically, or to transfer the set into an array of
Strings and sort the array.)
3. Provide a method for encrypting a word (represented by a String) by adding a
random (small) letter after each character in the original word. (Ex: “students”
may become “sutfuudwelnntaso”.)
4. Code the longest word from the user’s sentence and display the result. Ignore the
possibility that there may be more than one longest word.
5. Report how long (in seconds) it took the user to think and type their sentence, and
how long it took the program to do the rest of the processing. (You may want to
re-use the StopWatch class from one of the projects discussed.)
6. Repeat the whole procedure until the user types an empty line.
Grading
You get one point for each problem that you solve correctly. You get half a point for a
solution that is incomplete or slightly incorrect but displays effort in the right direction.
You earn a grade based on the number of points that you accumulate:
1 point: D
2 points: C
3 points: C+
4 points: B
5 points: B+
6 points: A
pf2

Partial preview of the text

Download 6 Problems in Midterm Exam - Object Oriented Programming | 547 202 and more Exams Information Technology in PDF only on Docsity!

04:547:202 – Object-Oriented Programming

Midterm exam

Problems

Imagine that you are part of a team working on a project to develop an interactive help system. Below are the requirements that you need to implement.

  1. Invite the user to describe their problem. Read the user’s sentence and display each distinct word in the user’s input. Ignore differences in capitalization. (You may want to re-use the InputReader class from one of the projects discussed.)
  2. Display the words from the user’s sentence in alphabetical order. (You may want to use a set that orders items automatically, or to transfer the set into an array of Strings and sort the array.)
  3. Provide a method for encrypting a word (represented by a String) by adding a random (small) letter after each character in the original word. (Ex: “students” may become “sutfuudwelnntaso”.)
  4. Code the longest word from the user’s sentence and display the result. Ignore the possibility that there may be more than one longest word.
  5. Report how long (in seconds) it took the user to think and type their sentence, and how long it took the program to do the rest of the processing. (You may want to re-use the StopWatch class from one of the projects discussed.)
  6. Repeat the whole procedure until the user types an empty line.

Grading

You get one point for each problem that you solve correctly. You get half a point for a solution that is incomplete or slightly incorrect but displays effort in the right direction. You earn a grade based on the number of points that you accumulate: 1 point: D 2 points: C 3 points: C+ 4 points: B 5 points: B+ 6 points: A

Notes

Arrange your solution so that you address the problems independently. For example, even if you do not know how to read user input in problem 1, you can solve the rest of the problems by assuming that the user input is available in a local variable of an appropriate type (String, Set, or whatever else you want). During the exam you may use any Java documentation (printed or online), textbooks, lecture notes or text editors. You may access the BlueJ projects and your own solutions to homeworks, if you wish.

This is an individual examination. You may not use communication tools or software during the exam (mobile phone, email, chat, …) and you may not discuss or exchange ideas or code with your colleagues. Ask me if you have any questions.

Submission

Before the end of the exam send me an email (muresan@scils.rutgers.edu) with the following attachments:

  • the Java files that you wrote or re-used (and possibly adapted) from other projects. (Ex: your solution may be in Exam.java, and may use the file InputReader.java.)
  • an output.doc Word file that contains the output of the interaction (i.e. the content of the terminal window, if you use BlueJ): the invitation for the user to type their sentence, the user’s sentence (which you will type), and the outcome of processing that sentence.

Also, upload onto your eden 202 website the full BlueJ exam project (if you choose to use software other than BlueJ for developing the solution, upload the full folder with your files) and the output.doc document.

Good luck !!