CMPS-3350 Software Engineering Lab-4
The components of this lab are:
Do the coding of your C++ program for this lab on your local Desktop.
At the end of lab class, your program files must be on Odin.
xlab4.c mylab4.cpp Makefile in your 3350/4/ directory on Odin.
All of your work will be viewed and collected at lab end.
Programs must compile and files must be in-place.
Create a C++ program using the code sample at: /home/fac/gordon/p/3350/code/lab4/xlab4.c Important: Save this program immediately to your Odin 3350/4/ folder please. No changes or fixes should be applied to the C program.
Create a Makefile to build your C and C++ programs. Note: You are refactoring a C program into the C++ language. Copy the C program to a C++ program named 3350/4/mylab4.cpp Complete the rest of the Makefile. Build your programs with make.
Please fix all compile warnings and errors. Enter a comment above the code related to each error or warning that you fix. Include the original code that was fixed, in the comment. For example://--------------------------------------------------------------------- //Fixed warning: deprecated conversion from string constant to 'char*' //Previous code was: // void getHost(char *hostname) //--------------------------------------------------------------------- void getHost(const char *hostname) { ... ... ...Step 4a: . Style this program using the Linux Kernel Style Guide. Main features... . Apply perfect K&R bracing, spacing, and indenting. . No lines will wrap on an 80-character window. . Choose hard-tabs or spaces for indenting. Not both. . One command per line-of-code. . Fix all compile warnings and errors.Step 4 note: It is acceptable to fix a compile warning by using type-casting. Such as casting a function call argument.
Run lab4 with the following parameters...
Run lab4 with the following parameters...
Create a PHP program in your Odin public_html directory... It will have this URL: https://cs.csub.edu/~username/3350/lab4.php where username is your own Odin account name. If you have any questions about the path to your lab4.php, please ask about it during lab. Here is a sample PHP program example...<?php
echo "This is output from my php file.";
?>
Run your lab4 program and contact your PHP file. like this... except insert your own username ./lab4 odin.cs.csub.edu /~username/3350/lab4.php
Use a web browser to look at your php file like this... https://www.cs.csub.edu/~username/3350/lab4.php
Make some minor changes to your lab4.php program... Allow the program to accept input: $param = $_GET['param']; Process the $param variable in the PHP file. Your new PHP program will look like this...
<?php
$param = $_GET['param'];
echo "param is: " . $param . "<br>";
if ($param == "hello") {
echo "Hello student!<br>";
} else {
$num = $param*3+4;
echo "number:" . $num . "<br>";
}
echo "<br>";
echo "<img src=\"mydiagram4.gif\"/>";
?>
Required: 1. Create a file named mydiagram4.gif for your diagram below. For image file conversion... You may use GIMP for file conversion. You may also use convert from the Odin command-prompt. example: $ convert image.jpg mydiagram4.gif Inside your <img> tag, apply a style element that will size your diagram to an appropriate size. example: style="width:800px;height:auto;" The <img> tag is in your php file.
Run your lab4.cpp program and contact your PHP file like this... ./lab4 odin.cs.csub.edu /~username/3350/lab4.php?param=hello Then try this... ./lab4 odin.cs.csub.edu /~myname/3350/lab4.php?param=345 You should see the appropriate data returned.
Draw a Diagram!
Draw a Diagram to show the components of your system, and how they interact with each other. Think about the flow of data through the system. How would a user interact with the system?
. Create an original diagram.Your diagram may be a flow-chart data-flow-diagram use-case diagram etc.
3350/4/xlab4.c 3350/4/mylab4.cpp 3350/4/Makefile public_html/3350/lab4.php public_html/3350/mydiagram4.gif Your instructor will contact your PHP file, with various parameters. Copy your diagram image file to your web directory, so it will be displayed when your web page (lab4.php) is viewed.