Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need the design document or pseudo code, the test case, the java source code, and output screenshot for the following project. Thanks CMSC203 Assignment
I need the design document or pseudo code, the test case, the java source code, and output screenshot for the following project. Thanks
CMSC203 Assignment #2 ssignment Details 1 10 MPH over Emit $140.00 ini 5200.00 school zone 5250.00 work zone Speeding Tickets +300.00 DIV Sureharge for 21-10 MPH S31000 mtmin school zone S360.00 miimoek zone MzAppe ckets reaire tte LINI uskut .rs.. N." 4AX.. 1 :.. Hae in additinnnying a tin 31 MPII over vit NA-uct appear perscealy oe by counsel DIV surchargc for 31 40 MPI $450.00 DMV surcharge for 41 MPH & up: 5675.00 ssiguent Deseription Concepts rested by this assignment Classes Data Elemeut Class bxample of ck Ixiver. Examples Sample Runs Deliverables ):.ia..nc.d44ILLa niaalauilu:Puk-sskia .:lal. application with. There must be at least 4 sets of valid data and at least one set of invalid data Screenshots of at least two of the test cases in your test table o UML diagram In three or more paragraphs, highlights of your learning experience Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats LastNameFirstName_Assignment5 _Complete.zip, a compressed file in the zip format, with the following o Write up (Word document) reflection paragraphs, test cases, screenshots o UML Diagram latest version (Word or jpg document) doc (directory) - Javadoc Filel.html (example) . File2.html (example) o o src (directory) Filel.java (example) File2.java (example) LastNameFirstName_Assignment5_Moss.zip, a compressed file containing one or more Java files: o Filel.java (example) o File2.java (example) This folder should contain Java source files only Package Class Use Tree Deprecated Inder Help Class Ticket 1avalang.object extended by Ticket public class Ticket extends java.larg.Cbjuet Constructor Summary Ticket(1ava,lang.String name, int speed, int speedLimit) Crcates a Title bictith the given namc. spei. spcx imi Ticket(iav.larig.String nam, irt spe, int sccdimit, bcclean hool, haola ork Creates a Title objcct with the given name. spoed. spcod limit, school one and work zonc. Method Summary double calculateFine) Calculat the spc tinc iavalang.srideternineTicketlype) Retun the ticketlypc of Payuble or Must Attend ava.lang.trE getNane Gel nume et speed in Cict specdlimit Get tickelNum Java. lane-trn IicketTRe bzolean 15schoolzone) bole isNorkzanc) Gel the likelType Whether vinlater was in sehnol 0nc Whether violater was in work zonc Prin a otive to be sent to the speeder Must follwexact formut setName(Java.lang.String name) Sel wme vod set5choolzonbolean schoolzone) void setspeadi int speed) vid setspeedinit npedLinit) Set if vinlater was in shol one Sct spocd Set soecdlimit Sel Tickel LU settorkzoneboolean workZone) Set if violater was iwok zone java. lang.string totrinei) Strins representation of the ticket cet No spoeme ormat Must include at a minimum Namo spoed speedlimit ticket number and ticket v e Methods inherited equals, get.Class, from class java.lang.Objeet hashCode, na tify, rict. ifyAli, : 1 t , ~ait, hait Constructor Detail Ticket public Ticket(java.lang.String nane, int speed, int speeLinit, ran schaol, boolean work) Creares a Title ohject with the given name, speed, spee limit, schoo one and wark zone Purameters: name narne of the vinlar speed speed violator was going speedLimit - lhe speelliil hal whether in a schnl nor not work whcthe in a work zonc or not Ticket pic Ticketjavn. lang.strina na int speec, int speedLinit) Creale a Tile ubje wih the given nme, speed, sped liil. school zoue and wurk zoue are se o false Paramcters: narre uaiue uf the viulator spaed-speed violatr was going speedLimi the specdlimit Method Detail gctName public javaeng.String geta) Get nume Returns: na1n1e setName public void setuane( Java. lang.String nane) Set name Parameters: nane ame lo be set getSpeed public trt Cict sneed Rcturns: speed setSpeed public vpid setSpeint pe) Sct speed Parameters: speed speeil w be sest getSpeedLimit public it getspeedlinit() Cret speedlimit Returns: speedlimi setSpecdlimit public void setSpeedLimit(int speedLinit) Set spccdlimit Parameters: speedlinit speedlimit to he set getTieketNum public int getTicketNum Cret ticketNum Rcturns: tickel mber Returns: the tieket Type getTicketType public java.lang.String getTicketType) Get the ticketType Returns: the ticketType printNotice public java.lang.String printNotice() Print a notice to be sent to the speeder Must follow exact format. See assignment description Note: There are no blank lines before "Department of Motor Vehicles" There are two blank lines between "Automated Traffic Enforcement" and the "Dear (name)" There is one black line betwcen "Dcar (name)" and "Pleasc pay." Based on the following data: Name: Betty Boop Speed: 58 Speed Limit: 25 School Zone: No Work Zone: Yes Department of Motor Vehicles Automated Traftic Enforcement //test calculateFine f(! (31e.0-=ticket1.calculateFine())) f(! (668.0-ticket2.calculateFine())) if(!(675.0==ticket3.calculateFine())) print("calculateFine print("calculateFine print("calculateFine Error Error Error 1"); 2"); 3"); //test getTicketType if(! "PAYABLE".equals(ticket1.getTicketType())) print("getTicketType Error 1"); if(!"PAYABLE".equals(ticket2.getTicketType())) print("getTicketType Error 2"); if(!"MUST APPEAR".equals(ticket3.getTicketType())) print("getTicketType Error 3"); //test printNotice string result = ticket1.printNotice(); Scanner scan new Scanner (result); if(! "Department of Motor Vehicles" .equals (scan.nextLine())) print("printNotice Error 1"); scan.nextLine(); //Automated Traffic Enforcement scan.nextLine(); scan.nextLine(); //two blank lines it(. "Dear Bob Brown, ".equals(scan.next Line())) print( "printNotice Error 2"); scan.nextLine(); // blank line if(! (scan.nextLine().contains("fine of $310.00"))) print("printNotice Error 3"); scan.nextLine();//receiving this notice String 1ine - scan.nextLine(); if(!(line.contains("for going 36 MPH in a 25 MPH school zone"))) print("printNotice Error 4"); scan.nextLine(); //blank line linescan.nextLine(); if(!(line.contains("Ticket Type: PAYABLE"))) print("printNotice Error 5"); scan.close(); //test toString String result1 - ticket1.toString(); if( ! (result1.contains("Bob Brown"))) print("toString Error 1"); if(! (result1.contains("36"))) print("toString Error 2"); if( ! (result1.contains("25"))) print("toString Error 3"); if(! (result1.contains("PAYABLE"))) print("toString Error 4"); //test setName ticket1.setName( "Ronald Reagan"); f(! "Ronald Reagan".equals(ticket 1 .getName())) print( "setName Error 1"); //test setSpeed ticket2.setSpeed (68); f(! (68-ticket2.getSpeed())) print(''setSpeed Error 1"); //test setSpeedLimit ticket3.setSpeedLimit(50); if(! (50--ticket3.getSpeedLimit())) print(" setSpeedLimit Error 1"); CMSC203 Assignment #2 ssignment Details 1 10 MPH over Emit $140.00 ini 5200.00 school zone 5250.00 work zone Speeding Tickets +300.00 DIV Sureharge for 21-10 MPH S31000 mtmin school zone S360.00 miimoek zone MzAppe ckets reaire tte LINI uskut .rs.. N." 4AX.. 1 :.. Hae in additinnnying a tin 31 MPII over vit NA-uct appear perscealy oe by counsel DIV surchargc for 31 40 MPI $450.00 DMV surcharge for 41 MPH & up: 5675.00 ssiguent Deseription Concepts rested by this assignment Classes Data Elemeut Class bxample of ck Ixiver. Examples Sample Runs Deliverables ):.ia..nc.d44ILLa niaalauilu:Puk-sskia .:lal. application with. There must be at least 4 sets of valid data and at least one set of invalid data Screenshots of at least two of the test cases in your test table o UML diagram In three or more paragraphs, highlights of your learning experience Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats LastNameFirstName_Assignment5 _Complete.zip, a compressed file in the zip format, with the following o Write up (Word document) reflection paragraphs, test cases, screenshots o UML Diagram latest version (Word or jpg document) doc (directory) - Javadoc Filel.html (example) . File2.html (example) o o src (directory) Filel.java (example) File2.java (example) LastNameFirstName_Assignment5_Moss.zip, a compressed file containing one or more Java files: o Filel.java (example) o File2.java (example) This folder should contain Java source files only Package Class Use Tree Deprecated Inder Help Class Ticket 1avalang.object extended by Ticket public class Ticket extends java.larg.Cbjuet Constructor Summary Ticket(1ava,lang.String name, int speed, int speedLimit) Crcates a Title bictith the given namc. spei. spcx imi Ticket(iav.larig.String nam, irt spe, int sccdimit, bcclean hool, haola ork Creates a Title objcct with the given name. spoed. spcod limit, school one and work zonc. Method Summary double calculateFine) Calculat the spc tinc iavalang.srideternineTicketlype) Retun the ticketlypc of Payuble or Must Attend ava.lang.trE getNane Gel nume et speed in Cict specdlimit Get tickelNum Java. lane-trn IicketTRe bzolean 15schoolzone) bole isNorkzanc) Gel the likelType Whether vinlater was in sehnol 0nc Whether violater was in work zonc Prin a otive to be sent to the speeder Must follwexact formut setName(Java.lang.String name) Sel wme vod set5choolzonbolean schoolzone) void setspeadi int speed) vid setspeedinit npedLinit) Set if vinlater was in shol one Sct spocd Set soecdlimit Sel Tickel LU settorkzoneboolean workZone) Set if violater was iwok zone java. lang.string totrinei) Strins representation of the ticket cet No spoeme ormat Must include at a minimum Namo spoed speedlimit ticket number and ticket v e Methods inherited equals, get.Class, from class java.lang.Objeet hashCode, na tify, rict. ifyAli, : 1 t , ~ait, hait Constructor Detail Ticket public Ticket(java.lang.String nane, int speed, int speeLinit, ran schaol, boolean work) Creares a Title ohject with the given name, speed, spee limit, schoo one and wark zone Purameters: name narne of the vinlar speed speed violator was going speedLimit - lhe speelliil hal whether in a schnl nor not work whcthe in a work zonc or not Ticket pic Ticketjavn. lang.strina na int speec, int speedLinit) Creale a Tile ubje wih the given nme, speed, sped liil. school zoue and wurk zoue are se o false Paramcters: narre uaiue uf the viulator spaed-speed violatr was going speedLimi the specdlimit Method Detail gctName public javaeng.String geta) Get nume Returns: na1n1e setName public void setuane( Java. lang.String nane) Set name Parameters: nane ame lo be set getSpeed public trt Cict sneed Rcturns: speed setSpeed public vpid setSpeint pe) Sct speed Parameters: speed speeil w be sest getSpeedLimit public it getspeedlinit() Cret speedlimit Returns: speedlimi setSpecdlimit public void setSpeedLimit(int speedLinit) Set spccdlimit Parameters: speedlinit speedlimit to he set getTieketNum public int getTicketNum Cret ticketNum Rcturns: tickel mber Returns: the tieket Type getTicketType public java.lang.String getTicketType) Get the ticketType Returns: the ticketType printNotice public java.lang.String printNotice() Print a notice to be sent to the speeder Must follow exact format. See assignment description Note: There are no blank lines before "Department of Motor Vehicles" There are two blank lines between "Automated Traffic Enforcement" and the "Dear (name)" There is one black line betwcen "Dcar (name)" and "Pleasc pay." Based on the following data: Name: Betty Boop Speed: 58 Speed Limit: 25 School Zone: No Work Zone: Yes Department of Motor Vehicles Automated Traftic Enforcement //test calculateFine f(! (31e.0-=ticket1.calculateFine())) f(! (668.0-ticket2.calculateFine())) if(!(675.0==ticket3.calculateFine())) print("calculateFine print("calculateFine print("calculateFine Error Error Error 1"); 2"); 3"); //test getTicketType if(! "PAYABLE".equals(ticket1.getTicketType())) print("getTicketType Error 1"); if(!"PAYABLE".equals(ticket2.getTicketType())) print("getTicketType Error 2"); if(!"MUST APPEAR".equals(ticket3.getTicketType())) print("getTicketType Error 3"); //test printNotice string result = ticket1.printNotice(); Scanner scan new Scanner (result); if(! "Department of Motor Vehicles" .equals (scan.nextLine())) print("printNotice Error 1"); scan.nextLine(); //Automated Traffic Enforcement scan.nextLine(); scan.nextLine(); //two blank lines it(. "Dear Bob Brown, ".equals(scan.next Line())) print( "printNotice Error 2"); scan.nextLine(); // blank line if(! (scan.nextLine().contains("fine of $310.00"))) print("printNotice Error 3"); scan.nextLine();//receiving this notice String 1ine - scan.nextLine(); if(!(line.contains("for going 36 MPH in a 25 MPH school zone"))) print("printNotice Error 4"); scan.nextLine(); //blank line linescan.nextLine(); if(!(line.contains("Ticket Type: PAYABLE"))) print("printNotice Error 5"); scan.close(); //test toString String result1 - ticket1.toString(); if( ! (result1.contains("Bob Brown"))) print("toString Error 1"); if(! (result1.contains("36"))) print("toString Error 2"); if( ! (result1.contains("25"))) print("toString Error 3"); if(! (result1.contains("PAYABLE"))) print("toString Error 4"); //test setName ticket1.setName( "Ronald Reagan"); f(! "Ronald Reagan".equals(ticket 1 .getName())) print( "setName Error 1"); //test setSpeed ticket2.setSpeed (68); f(! (68-ticket2.getSpeed())) print(''setSpeed Error 1"); //test setSpeedLimit ticket3.setSpeedLimit(50); if(! (50--ticket3.getSpeedLimit())) print(" setSpeedLimit Error 1")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started