Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

NOS 120 final all sets Unlocking Knowledge: A Comprehensive Guide to the NOS 120 Final E, Exams of Information Technology

NOS 120 final all sets Unlocking Knowledge: A Comprehensive Guide to the NOS 120 Final Exam All Sets.. An Ultimate Exam Study Guide Latest Updated 2025/2026 100% Certified and Verified Answers by Expert.

Typology: Exams

2024/2025

Available from 06/11/2025

charleswest
charleswest 🇺🇸

4.2

(12)

1.3K documents

1 / 86

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
NOS 120 final all sets Unlocking Knowledge:
A Comprehensive Guide to the NOS 120
Final Exam All Sets..
An Ultimate Exam Study Guide Latest Updated
2025/2026
100% Certified and Verified Answers by Expert.
Write a C program called fedora.c that displays the line "Fedora is a version of Linux." -
ans#include <stdio.h>
int main()
{
printf("Fedora is a version of Linux.\n");
}
Create a simple C program which declares the variable number as a local variable that is an
integer. - ansint number;
int main()
{
}
Modify the rain.c program you created in this chapter so that the total of all inches of rain
when added together is
136 inches. - ans#include <stdio.h>
int main()
{
int rain, total_rain = 0;
for (rain = 0; rain < 17; rain++)
{
printf("We have had %d inches of rain.\n", rain);
total_rain = total_rain + rain;
}
printf("We have had a total ");
printf("of %d inches of rain.\n", total_rain);
}
Write a program in which a prompt asks for your first name and after you enter your first
name the program displays
it. - ans#include <stdio.h>
int main()
{
char string[20];
printf("\nEnter your first name: ");
scanf("%s", string);
printf("Your first name is: %s\n", string);
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56

Partial preview of the text

Download NOS 120 final all sets Unlocking Knowledge: A Comprehensive Guide to the NOS 120 Final E and more Exams Information Technology in PDF only on Docsity!

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

Write a C program called fedora.c that displays the line "Fedora is a version of Linux." - ans#include <stdio.h> int main() { printf("Fedora is a version of Linux.\n"); } Create a simple C program which declares the variable number as a local variable that is an integer. - ansint number; int main() { } Modify the rain.c program you created in this chapter so that the total of all inches of rain when added together is 136 inches. - ans#include <stdio.h> int main() { int rain, total_rain = 0; for (rain = 0; rain < 17; rain++) { printf("We have had %d inches of rain.\n", rain); total_rain = total_rain + rain; } printf("We have had a total "); printf("of %d inches of rain.\n", total_rain); } Write a program in which a prompt asks for your first name and after you enter your first name the program displays it. - ans#include <stdio.h> int main() { char string[20]; printf("\nEnter your first name: "); scanf("%s", string); printf("Your first name is: %s\n", string);

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

Write a program in which you enter a number and the program calculates and displays that number cubed. - ans#include <stdio.h> int main(void) { int num, cube; printf("\nEnter the number to cube: "); scanf("%d", &num); cube = numnumnum; printf("Your number cubed is: %d\n", cube); } Create a program that enables you to input a positive integer and that will then tell you if it is a prime number or if it can be divided by 2. - ans#include <stdio.h> int main (void) { int num; int count; int signal; printf("Enter the number to test: "); scanf("%d", &num); for (count=2, signal=1; (count<=(num/2)) && signal; ) { if ((num % count) ==0) signal = 0; else count++; } if (signal) printf("%d is prime\n", num); else printf("%d has %d as a factor\n", num, count); }

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

float my_money; int weight; cout << "\nEnter your First Name: "; cin >> string; cout << "\nEnter your Desired Monthly Income: "; cin >> my_money; cout << "\nEnter your friend's weight: "; cin >> weight; cout << "\n\n Recap\n"; cout << "I am " << string; cout << " and I wish to have " << my_money; cout << " per month"; cout << "\nI never would have guessed your friend weighs " << weight; cout << "\n\n"; } Create a C++ program that tests to see if the file accounts exists and prints a message to say whether the file exists. - ans#include #include using namespace std; int main(void) { ifstream file("accounts"); if (file.fail()) cout << "Can't find the accounts file.\n"; else { cout << "The accounts file exits.\n"; } } Write a Perl script to display the line "Perl was developed by Larry Wall". - ans#!/usr/bin/perl

Program name: exercise1.pl

print ("Perl was developed by Larry Wall\n"); Write a Perl script in which you create a variable in the script to contain the name Beth and then have the script

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

display "Welcome Beth." - ans#!/usr/bin/perl

Program name: exercise2.pl

$name = "Beth"; print ("Welcome $name\n"); Modify the script you wrote in Exercise 2 so that you prompt for the name and then display "Welcome name". - ans#!/usr/bin/perl

Program name: exercise3.pl

print ("Enter your first name: "); $name = ; print ("Welcome $name\n"); Write down four scalar variables, two of which are numeric and two that are strings. - ans$value = 45; $m = 90; $furniture = "desk"; $car = "Ford"; Create a Perl program that uses an array of vegetables—peas, carrots, spinach, corn, beans— and in which all of the vegetables in the array are displayed to the screen. - ans#!/usr/bin/perl

Program name: exercise5.pl

@vegetables = ("peas", "carrots", "spinach", "corn", "beans"); print ("The vegetables on my list are:\n"); print ("$vegetables[0]\n"); print ("$vegetables[1]\n"); print ("$vegetables[2]\n"); print ("$vegetables[3]\n"); print ("$vegetables[4]\n"); Design a Perl program that sorts the last names Martin, Adams, Sandoval, Perry, Yablonsky, Brown, and Ramirez.. - ans#!/usr/bin/perl #Program name: exercise6.pl @namelist = (Martin, Adams, Sandoval, Perry, Yablonsky, Brown, Ramirez); @sortednames = sort @namelist; print "@sortednames"; print"\n"; Write a Perl program that attempts to open a file that does not exist, and that prints the message "That file is

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

Key Value 1 Martin 2 Hanson 3 Stephens 4 Rawlins - ans#!/usr/bin/perl

Program name: exercise10.pl

%peoplelist = ('Martin', 1, 'Hanson', 2, 'Stephens', 3, 'Rawlins', 4); print ("The keys are:\n"); print ("$peoplelist{'Martin'}\n"); print ("$peoplelist{'Hanson'}\n"); print ("$peoplelist{'Stephens'}\n"); print ("$peoplelist{'Rawlins'}\n"); dd [option] - anscopies an input file and can convert the file's contents to another format or to have different characteristics dd if - ansdesignates the input file dd of - ansdesignates the output file df [-options] [filesystems] - ansdisplays how space in a disk is allocated, used and free

  • h human readable
  • l only local
  • m size in mb
  • t only type of file system du [-options] [filesystem] - anssummarizes disk usage, with the default of presenting info by directory
  • a files and directories
  • b displays info in bytes
  • c creates a total at the end
  • h human readable
  • S omits size of subdirectories in totals for directories Use the df command to view file system use in megabytes. - ansdf - m top [options] - ansmonitors CPU intensive stacks (doesn't need - for options) d: delay between screen updates p: monitors process w specified process id q: causes the top utility to refresh wo delay

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

s: secure mode S: cumulative mode n: specifies how many times to update b: batch update (must also use w n) i: ignores any idle processes c: displays the command line instead of teh command name only uptime - ansdisplays how long the system has been up since the last boot free [-options] - ansprovides stats about free and used memory

  • b displays in bytes
  • m displays in mb
  • g in gb
  • s n continuous (ctrl c to end)
  • t creates totals for RAM and swap mem statistics Use the touch command to create the file letters. Next use the dd command to make a backup of the file. - anstouch letters dd if=letters of=letters.bak Use the command that gives you information about swap space and memory use. - ansfree Start the top utility. Notice that top is listed as one of the most active processes. Determine what CPU percentage is used by running top. Stop the top utility. - anstop q Start the top utility so that it updates every 20 seconds. Now do you see top in the list of the most active processes on your screen? Stop the top utility - anstop d 20 q Use the command to determine which users have processes running on your system. - ansps - Au ps [-options] - ansprovides a listing of the currently running processes
  • A or - e shows all processes selected on the specified command na,e
  • p PID shows processes selected on the PID
  • l PID shows a long listing of information about processes l PID (longer than - l PID) Log in as root and try using ifconfig, netstat, and route. Also, when you use ifconfig, record the "inet addr"

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

Start the top utility. Type? after the utility starts. What information do you see? Press Enter and stop the top utility. - anstop ? q Run the man program with the argument df in the background. Record the PID of the process you have started. - ansman df& Save and test the revised phmenu.1 file using the groff and man programs. - ansgroff - Tascii - man ./phmneu.1 | more man ./phmenu. Use the command that will enable you to view the documentation for ifconfig. Notice the many options for configuring your network connection. - ansifconfig Find out the IP address of a friend's computer or of a favorite Web site and use the command to poll that computer or Web site. - ansping [ip address] Use a command to view the contents of the /etc/init.d directory to see a listing of services you can start on your computer. Do you see the portmap file - ansls /etc/init.d dump [-options] devicename and partition or filename - ansbacks up files and directories uses 9 levels, 0: all files 1: all files since last bu, 2: since all level 1, and so on restore [-options] device partition or filename - ansrestores entire filesystems, specific files, and directories

  • f device or - file specifies device or file
  • i runs in interactive mode
  • N shows file names and directories on the backup medium
  • r restores a file system
  • x specifies certain files or directories to be restored mail [-options] [username] - ansenables you to send/get mail through computer or server netstat [-options] host - ansmonitors network traffic on host computer
  • a diplays stats for ports used by transport protocol
  • p shows programs in use related to active ports
  • n displays communications via ip and port numbers

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

  • s shows all stats bash shell prefix - ans#!/bin/bash test [-options] [argument/expression/integer] - ansused to analyze an expression to see ifi its true, often used in shell scripts, to see if files exist test - d - anstests for the existence of a specific directory test - e - anstests existence of a file test - r - ansdetermines if file has read permission test - s - ansdetermines if file is not empty test - w - ansdetermines if file has write permissions test - x - ansdetermines if file is executable test - nt - anscompares first file in arg w second to see if first is newer test - ot - anscompares first file in arg w second to see if first is older test - eq - anscompares two integers to determine if they are equal test -! - ansdetermines if an expression is fales test stringa = stringb - ansdetermines if two strings are eyal What are the exit statuses of the test command discussed in this chapter and what do they mean? How can you view the exit status results of the test command directly from the command line? - ansThere are two exit statuses. Exit status 0 means true and exit status 1 means false. Type echo $? and press Enter to view the test command results exit status (test) - ansnumeric value that the command returns to the os when finished test: 0=true 1=false Create a variable called mem_size and set its contents to 1024. Next, use the test command to determine if the contents of mem_size is less than or equal to 512. - ansmem_size= test $mem_size - le 512 echo $? test - a - anslogical AND test - o - anslogical OR test! - anslogical negation shell function - ansa group of commands stored in memory and assigned a name Set your shell from the command line to be the Bash shell. Then, use the echo command to verify the contents of the shell variable. What is now contained in the shell variable? - ansbash echo $SHELL

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

How could you set up CALNOW so that it works every time you log in using the Bash shell?

  • ansEdit .bashrc or .bash_profile to contain the lines: CALNOW=cal List the records in the corp_phones_bak file that you created earlier, so that they are displayed without colons separating the fields, but have one space between fields instead. - anscd ~/source cat corp_phones_bak | tr ":" " " In your source directory, write a script called "them" in which you create a function called thethat displays a listing of who is logged in and displays the column headings for the information displayed. - anscd ~/source vi them whoisthere() { who - H } Modify your whoisthere function so that you can enter "These are the folks logged in:" as an argument to appear before you list who is logged into the system. - answhoisthere() { echo "$1" who - H } How can you set up your new whoisthere function so that it can be run each time you log in using the Bash script? - ansSwitch to the home directory (cd and press Enter). Edit the .bashrc or .bash_profile login script to contain the line:. ~/source/them. Use a one line command to strip out the telephone prefix (219-) and the colons in the corp_phones_bak file and save the result in a file called noprefix? - anscd ~/source cat corp_phones_bak | tr - d : | tr - d 219- > noprefix Bash Shell - ansfrom bourne and korn csh/tcsh - ansfrom C shell ksh/zsh - ansfrom korn shell how shell scripts work - ansUNIX/Linux acts as an interpreter and compiles and executes in the same act

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

printenv - ansview list of current configuration(usually not changed) and environment (can be changed as needed) variables. You should to this before you change any Use two different commands to display the contents of the HOME variable - ansType printenv HOME and press Enter. Also, type echo $HOME and press Enter. echo ($) prints out a variable printenv views all variables, or single ones when specified printenv [-option] [variable name] - ansprints a listing of environment and configuration variables specifies one or more vars as arguments to view info only about thos to reference a variable - ansenclose in {} or precede with $ let [expression with operators] - ansperforms a given action on numbers that is specified by operators, and value is stored in a shell var PEMDAS Assign the variable t the value of 20. Next, assign the variable s the value of t+30. Finally, display the contents of t and s to verify you have correctly defined these variables. - anst= let s=t+ echo $t echo $s set [-options] [arguments] - answ no options, displays the current listing of bash environment and shell script vars set - a set - n set - o, set - o noclobber set - u set - v - ansset - a: exports all vars after defined set - n: takes commands w/o executing them set-o: sets a particular shell mode

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

environment to prevent you from overwriting a file - anscd set - o noclobber shell logic structures - anssequential logic decision logic looping logic case logic sequential logic - anscommands are executed in the order in which the appear in the script or program decision logic - ansexecute statement(s) according to certain conditions (if then, else) Create an alias called var that displays your environment variables. - ansalias var=" printenv" looping logic - ansfor loops At the command line use a for loop that uses the variable sandwiches and then displays a line at a time the following sandwiches: chicken, ham, hummus, tomato. - ansfor sandwiches in chicken ham hummus tomato do echo $sandwhiches done case logic - ansmatch from a list (menu) Create a script that uses case logic to have someone guess your favorite sandwich, such as tuna. - ansecho - n "Guess my favorite sandwich: " read guess case "$guess" in "tuna") echo "Tuna is my favorite sandwich" ;;

  • ) echo "Nope, actually I like tuna" ;; esac tput [-option] argument - anscan be used to initialize the terinal or terminal window display, position text and the cursor bold=tput smso offbold=tput rmso - ansenables/disables boldface tput clear - ansclears the screen tput cols - ansprints number of columns for the current terminal display tput cup - anspositions cursor and text on screen

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

tput cup 0 0 : moves cursor to row 0, column 0, upper left corner sh [-options] [shell script name] - anschecks for bugs sh - n - anschecks syntax of a shell script but doesn't execute sh - v - ansdisplays lines of code whule executing a shell script sh - x - ansdisplays the command and arguments as a shell script is run login script - ansruns after you log in alias [-options] [name = "command"] - ansname that represents another command alias - p: prints all aliases trap [command] [signal number] - answhen a signal is received from the operating system, the argument included with trap is executed

  • l diplays a listing of signal numbers and meanings common signals with trap - anstrap 0 completion of shellscript trap 1 a hangup or logout signal trap 2 an interrupt has been received trap 3 a quit signal has been issued trap 4 an illegal instruction has been received trap 9 a termination signal has been issued trap 15 a program has been ended trap 19 a process has been stopped trap 20 a process has been suspended Display the contents of .bashrc file. Next, use the vi editor to edit that file and put in an alias so that every time you type list you see a long file listing of a directory. - anscd more .bashrc use vi or Emacs to place the line alias list="ls - l" under the # User specific aliases and functions section in the file. Use a command to simulate how you would troubleshoot a problem with the sandwich script you created in Exercise 10. - anse sh - x (or sh - v) sandwich Use the let command to store the value 1024 in the variable ram. Display the contents of ram.
  • anslet ram= echo $ram

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

List all of the signal numbers and designations for the trap command. What is the designation for signal 31? - anstrap - l 31: SIGSYS Modify your script from Exercise 17 so that there is a beep when the menu is ready to take the user's input. - ansUse the line near the end as follows: tput cup 10 9; echo - e "Select a soup ... (q) to quit \a" Is there a command that you can use to prevent shell variables from being assigned new values? If so, what is it? - ansYes. Use the readonly command in the Bash shell. Which of the following roles implement what can be classified as infrastructure services? (Choose all that apply)? a. DNS b. Web Server (IIS) c. DHCP d. Remote Desktop Services - ansa. DNS c. DHCP Which of the following is a valid upgrade path to Windows Server 2012 R2? a. Windows Server 2003 Standard to Windows Server 2012 R2 Standard b. Windows Server 2008 Standard to Windows Server 2012 R2 Standard c. Windows Server 2008 R2 32-bit to Windows Server 2012 R2 64-bit d. Windows 7 Ultimate to Windows Server 2012 R2 Essentials - ansb. Windows Server 2008 Standard to Windows Server 2012 R2 Standard Which feature must you add to a Windows Server 2012 R2 Server Core installation to convert it to the Minimal Server Interface? Graphical Management Tools and Infrastructure Server Graphical Shell Windows PowerShell Microsoft Management Console - ansGraphical Management Tools and Infrastructure What is the name of the directory where Windows stores all of the operating system modules it might need to install at a later time?

A Comprehensive Guide to the NOS 120

Final Exam All Sets ..

An Ultimate Exam Study Guide Latest Updated

100% Certified and Verified Answers by Expert.

Windows System Bin WinSxS - ansWinSxS Which of the following are valid reasons why administrators might want to install their Windows Server 2012 R2 servers using the Server Core option? (Choose all that apply) A Server Core installation can be converted to the full GUI without reinstalling the operating system. The PowerShell 3.0 interface in Windows Server 2012 R2 includes more than 10 times as many cmdlets as PowerShell 2.0. The new Server Manager in Windows Server 2012 R2 makes it far easier to administer servers remotely. A Windows Server 2012 R2 Server Core license costs significantly less than a full GUI license. - ansA Server Core installation can be converted to the full GUI without reinstalling the operating system. The PowerShell 3.0 interface in Windows Server 2012 R2 includes more than 10 times as many cmdlets as PowerShell 2.0. The new Server Manager in Windows Server 2012 R2 makes it far easier to administer servers remotely. Windows Server 2012 R2 requires what processor architecture? a. 64-bit processor only b. 32-bit processor and 64-bit processor c. Any processor provided it is physical, not virtual d. Minimum dual-core processor - ansa. 64-bit processor only What are the minimum system memory requirements to run all editions of Windows Server 2012 R2? a. 256 MB RAM b. 512 MB RAM c. 2 GB RAM d. 4 GB RAM - ansb. 512 MB RAM What is the default installation of installing Windows Server 2012 R2? a. Server Core b. Startup GUI c. PowerShell