Fall 2020 cosc1550 - Programming Project 6. Due Sunday November 29th, 2020 9:00pm. 100 Points Possible Figure 1: Wed 15 Treadwell 1 Program Summary This is a continuation of the previous assignment...

Needs to be written in C++, have no hard coded values, and include the functions listed in the requirements.


Fall 2020 cosc1550 - Programming Project 6. Due Sunday November 29th, 2020 9:00pm. 100 Points Possible Figure 1: Wed 15 Treadwell 1 Program Summary This is a continuation of the previous assignment and is based on the code from project 5. Here is the background. In our last assignment we had to scan log files to find Wookie Hair Balls and Valve repair jobs. It seems that our modifications to the robot need some testing. So we are going to create log files for a test system. This time we are going to programmatically going to create wed files. We will make heavy use of the random number generator to help us with this task. 1 2 Data File Format The file suffix ends with wed. So a particular robot’s file might be robot1.wed. The file will have the following columns where data is separated by space characters. For this we don’t need to worry about negative numbers for the X,Y and Z coordinates. object name one word ASCII a-z, A-Z x float number y float number z float number An example of a particular file might be. wed 2013.30 100.90 13.08 laserblaster 100.09 32.70 45.01 r2d2speaker 10.00 100.00 10.00 handcannon 10.00 100.00 10.00 wookiehairball 9.30 99.90 9.08 princessearring 2.00 1.00 0.10 sithmajictrick 101.09 31.70 41.01 2 3 Program Behavior The program will do the following. 1: Display the message ”Treadwell Wed 15 File Generator”. 2: The program will ask for a logon. If it is a valid logon, then processing will commence on the wed data file. The password is solo 3: If the password is incorrect, give the user 3 attempts to get it right before displaying an error message and exiting from the program. 4: Ask the user for the file name that is the output file name. The file name will have to have the same ”.wed” file suffix. 5: The program should ask the user for how many records are to be created. Hard coded record limits are not acceptable for this assignment. Check that the user entered at least the number 1. If the user enters a number less than 1, than give the user the opportunity to enter the number correctly. If they enter a number less than 1, 3 times display an error message and exit the program. Make sure the file is not created. 6: One function will be objectBuilder that accepts an integer and returns a string with any one of 7 strings containing the name of the object. For example object number 3 might be ”sithmajictrick”. Object 4 might be ”laserblaster”. Inside this function you have at least 7 objects to create (hint: switch statement). You get to makeup the names of the objects, be creative. The object names don’t have any spaces in them. e.g. bad object name ”hand cannon”, good object name ”handcannon”. 7: Another function will be getChoice that has no parameters and returns a random integer number for choice. That choice number will be a number that helps choose which object we are going to create. 8: Still yet another function will be getNum that has no parameters and returns a random positive number from 0 to 999.99. These will be our coordinate numbers used for the x y and z portions of the file. 9: The program should display each created record once it is created. Big Hint: go find the code earlier in the book that uses the random function. It helps generate random integers. There were lots of examples. 3 Example output from the above file might be. Bold font numbers below are what the user would type in Interaction category: Login works and file writing WED-Treadwell Cybot Galactica, TARS login: solo Sensor file name please? robot1.wed How many records to generate? 7 Outputting file now blaster, 2013.33 100.90 -13.08 wookiehairball 100.09 32.70 45.01 princessearring 10.00 100.00 10.00 wookiehairball 10.00 100.00 10.00 bolt 9.30 99.99 9.08 type7dust -2.00 -1.00 -0.10 valverepairwhb 101.09 31.70 41.01 Interaction category: Login doesn’t work WED-Treadwell Cybot Galactica, TARS login: darth Error: Please enter valid login login: yoda Error: Please enter valid login login: chewie Error: Login Attempts Exceeded!! Exiting System!! Interaction category: user enters number less than 1, 3 times. WED-Treadwell Cybot Galactica, TARS login: solo Sensor file name please? robot1.wed How many records to generate? 0 Error: Must enter a number greater than or equal to 1 How many records to generate? -1 Error: Must enter a number greater than or equal to 1 How many records to generate? -1 Error: Attempts Exceeded Threshold Exiting System!! If there are any questions about what is required ask. 4 4 How to turn in the project. All that should be turned in is the file ending with the name cpp. So if you named your program source code file name_p05.cpp, all I want is that file. Make sure there are no space characters in the file name. Do not turn in the executable file. I will be recompiling your source code to make sure it works. You can turn in your wed files so I can see how you tested your code. Note, I will be compiling the source code on my own computer. Word documents or screen dumps of the code will receive a grade of 0. Don’t leave this assignment till the last moment. 5 5 Grading: How I will grade this programming assignment Note: I take a look at the source code and I compile each and every program submitted. My grading criteria is below. • 10% Does the source code look good? Proper indenting and spacing? Does it follow coding standards? • 10% Does the source code have comments? Is student’s name, class and section at the top of program? • 60% Does the program compile? Does the program run without errors? • 20% Does the program display the results as specified above? Note: If the program is just a mishmash of symbols and doesn’t compile, the program will get a special grade of 9 points. If you don’t like the grade you got for the assignment, you can fix it and resubmit it for a better grade 1 time. 6
Nov 29, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here