M4ritimeSeeker

PASS Week 1: Command Line and Basic Code

Jan 18th, 2022 (edited)
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 KB | None | 0 0
  1. PROBLEM 1: Interacting with systems software using standard input and the virtual terminal for output.
  2.  
  3. Follow the PASS leader as they ask you to follow their lead exploring your computer. Introduction to the File System using Systems Software. (Windows & Mac)
  4.  
  5. Windows Users:
  6. - Interact with the file system using utility software. (cmd)
  7. - From the root of the filesystem run through various utilities demonstrating how to (cd, dir) both text files and binary files are
  8. listed in the Windows environment.
  9. - Discuss the idea of filepath. (c:\Users\NXXXXX\Desktop).
  10. o The name of the executable program is a binary file.
  11. o The programs are created from source files.
  12.  
  13. Linux/Mac Users:
  14. - Interact with the file systems using the bash command terminal. (under utilities)
  15. - Change directory using the cd utility, list the files using the ls utility.
  16.  
  17.  
  18.  
  19. Quick List of Useful Commands and the Windows or Linux/Mac Equivalent
  20.  
  21. WINDOWS ------ LINUX/MAC
  22. dir ls (Lists the content of the directory you are in)
  23. cd cd (Change the current directory. Example: cd Downloads)
  24. cls clear (Clears all text from the terminal, making it easier to read)
  25. md mkdir (Make a new Directory. Example: mkdir NewDirectory)
  26. rmdir rmdir (Remove a Directory. Example: rmdir NewDirectory)
  27. copy NUL touch (Make a new file of any type. Example: copy NUL file.txt Example2: touch file.txt)
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. PROBLEM 2: Fixing Errors in Code
  46.  
  47. 3 types of Errors:
  48. • Syntax errors – wont compile because of incorrect syntax of the language
  49. • Logical errors – Gets the wrong answers but runs / bad design
  50. • Run time errors – Program ends unpredictably or unexpectedly / Usually due to accessing memory incorrectly.
  51.  
  52.  
  53. Copy the defective source code below exactly into the IDE of your choice. Attempt to compile it. Examine the compiler errors and fix the syntax errors one at a time starting with the firsterror on top of the errors reported. PASS leaders may need to help with scanf() and printf() modifiers. We learn these functions in Week 2.
  54.  
  55. Broken Program Source Code:
  56.  
  57. /**************************************************
  58. * Top comment code is not required for this example.
  59. * You would put your
  60. * N number here too.
  61. **************************************************
  62. #include <stdioh>
  63.  
  64. int main(int)
  65. {
  66. int age_In = 0:
  67. print("Enter in your age please.\n");
  68. scanf("%d", age_in);
  69. printf("You told me your age is: %f\n");
  70. return;
  71. }
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
Add Comment
Please, Sign In to add comment