Material Type: Exam;
Class: Computing for Engineers;
Subject: Computer Science;
University: Georgia Institute of Technology-Main Campus;
Term: Fall 2004;
Download Test 3 Questions with Solutions - Computing for Engineers | CS 1371 and more Exams Computer Science in PDF only on Docsity!
CS 1371 Test 3 Version 1 November 19" 2004 Problem 1 (20 pts): Java Classes Write a Java class called CS1371 consistent with the following instructions: 1. Write an appropriate Java class header. 2. Declare a variable called mya which is a string. 3. . Create a constructor that sets the variable myTA to a string passed into the constructor. 4. Write a toString () method that returns a string in the form: “This is CS1371, and is my TA” (< > indicates variable) 5. Write a main method where you create a CS1371 object and then print its toString (} method. pablic class CSASTLS Y VW chote Gtriny ry TAS (/ } constructor, git + peblic ducer TR (strona, n) 3 my TA mr ) 8 if fo STring . pe blic man to ptring {) % yelv Susteren pricy ("This is CSS TI awol™ t my TK a? 1% my TAY ‘Sy § eo public ge saain (String cy ares) 5 i wasn CS\B7\ mes new CS 134 ee we Me, declare TA (Abhinav): WE oto Strinay Mls pratt rage 20f6 wy Wag