Preview

Assignment 3 CS 113

Good Essays
Open Document
Open Document
804 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Assignment 3 CS 113
Assignment 3 (100 points)
CS 113 Fall 2014
Due Date: See Syllabus
Name & UCID & Section Number: Please write your name, UCID, and section number on the submission – please staple together – no loose sheets

What is to be submitted?
1. Problem 1: Answers to the exercises
2. Problem 2: Program listing with the program output using the input in file Data3.txt and user interaction based on the input you have entered.

1. Exercises (25 points)
a) (20 points) Show the syntax (form) , explain its meaning, and give an example of each of
i. while loop, ii. for loop, iii. if statement, iv. array (give an example declaration and its use), and
v. boolean type
b) (5 points) What does a break statement do when executed inside a loop?

2. Directory1 Lookup Application (75 points)
What is the assignment?
Write a directory (database) lookup application which operates by
1. reading a list of numbers stored in file Data3.txt to create a database of numbers:

1

The word directory is used here as it use in "telephone" directory or a "store" directory" as opposed to its use in
"file" directory which refers to the organization of files in a computer system such as Unix or Linux.

CS 113 Fall 2013 – Assignment 3

1/4




The list of numbers is preceded by a number (first number in the list) that specifies the size of the list.
This file name Data3.txt is supplied as a command-line argument to the application. 2. accepting user input (supplied at the keyboard) which are numbers that it checks to see whether or not they are in its database.
For each number x input by the user the program displays (prints) “x is in the list” or
“x is not in the list” depending upon whether or not x is in the list.
The program terminates when the user enters Ctrl-Z (Ctrl-D) on the keyboard.

Input File Data3.txt
14
21
222
210
-44
78
88
96
0
-1
88
7890
567
999
-101
The list has 14 values as indicated by the first value in the file.

Sample user interaction (submit your version of the user interaction)

You May Also Find These Documents Helpful

  • Powerful Essays

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 1488 Words
    • 6 Pages
    Powerful Essays
  • Good Essays

    It/210 Final Exam

    • 1235 Words
    • 5 Pages

    1. The program will present a series of user screens that prompts the user for specified input.…

    • 1235 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Mis 302 Flowchart

    • 262 Words
    • 2 Pages

    Complete Java Program to accept the required input and accordingly produce the output as expected.…

    • 262 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Nt1210 Chapter 1 Review

    • 1315 Words
    • 6 Pages

    8. Which of the following is not a feature of a file system that might be used with a hard disk dirve?…

    • 1315 Words
    • 6 Pages
    Good Essays
  • Satisfactory Essays

    CHAPTER3 REVEIW

    • 527 Words
    • 3 Pages

    6. A user has opened a word processor, typed the numbers 123456789, and stored the document as a file called report1. Which of the following determine, in part, what bits the computer stores in the file to represent the text typed into the report?…

    • 527 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    IT113 Unit 5

    • 393 Words
    • 2 Pages

    • Active Directory is a database of objects that are used to organize resources according to a…

    • 393 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1330 Unit 1 Study Guide

    • 1178 Words
    • 5 Pages

    A Database is generally used for storing data in a structured way in an efficient manner for insert, update and retrieval of data in well defined formats. On the other hand, in file system the data stored in unstructured manner with an unrelated data.…

    • 1178 Words
    • 5 Pages
    Powerful Essays
  • Satisfactory Essays

    Pt1420 Unit 7 Study Guide

    • 582 Words
    • 3 Pages

    17.Write a program to read a binary input from the keyboard and display it. Page: 130…

    • 582 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    |File – Is a place where data is stored on a computer, there are many different types of files and most if not all data is stored in a file. |…

    • 829 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    Nt1330 Unit 1 Assignment

    • 4639 Words
    • 19 Pages

    Computers store data ondisks using files, which are structured in specific ways in order to allow for faster access, higher reliability, and to make better use out of the drive's available space. The specific way in which files are stored on a disk is called a file system, and enables files to have names and attributes. It also allows them to be stored in a hierarchy of directories or folders arranged in a directory tree.…

    • 4639 Words
    • 19 Pages
    Powerful Essays
  • Good Essays

    Assignment 4 P7

    • 1047 Words
    • 5 Pages

    P7: Explain how team building leads to team cohesion in the public services, with reference to relevant theorists.…

    • 1047 Words
    • 5 Pages
    Good Essays
  • Good Essays

    You can even create interactive programs that allow the user to input values for variables…

    • 5177 Words
    • 21 Pages
    Good Essays
  • Satisfactory Essays

    IT Level 3

    • 1133 Words
    • 6 Pages

    The program tells us how to multiply the numbers that are put above, e.g. found coins = 20, magic coins =10 and stolen coins =3 which are from lines 1-3 and line 4 shows us a question which consists of those numbers. Line 5 shows us that stolen coins value is now 2 instead of 3 and line7 shows us that magic coins has also changed its value from 10 to 13.…

    • 1133 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    mba 539

    • 256 Words
    • 2 Pages

    If the answer input equals to the correct answer, system shows “Correct!”. If the answer input is not equal to the correct answer, system shows “Try again!” on screen.…

    • 256 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    1. Rewrite the following counter-control program to do while loop and for loop, in order to print out the biggest number inputted via keyboard.…

    • 1229 Words
    • 8 Pages
    Good Essays

Related Topics