UNIX/Linux Programming Answers

Questions: 170

Answers by our Experts: 135

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

You need to submit the code and program output.

 

Q1. you will write a C++ program that uses a for statement to calculate and display the sum of all even numbers between 5 and 24 inclusive on the screen.


Q2. Write statements that assign random integers to the variable n in the following ranges: Use the random function to generate the numbers. Put the statements in a C++ Program and run it.


a) 1 ≤ n ≤ 87 


b) 1 ≤ n ≤ 925 


c) 0 ≤ n ≤ 424 


d) 2000 ≤ n ≤ 3138


e) –16 ≤ n ≤ 65




You need to submit the code and program output

Q1. you will write a program that uses a for statement to calculate and display the sum of all odd numbers between 6 and 27 inclusive on the screen. 


Q2. Write statements that assign random integers to the variable n in the following ranges: Use the random function to generate the numbers. Put the statements in a C++  Program and run it.


  1. a) 1 ≤ n ≤ 54
  2. b) 1 ≤ n ≤ 910
  3. c) 0 ≤ n ≤ 194
  4. d) 1000 ≤ n ≤ 3125
  5. e) –19 ≤ n ≤ 31

Part 1:


You will use the Random function to write the following JAVA program. Write a program named Dice4.java.


  • You are given two dices.
  • Each dice has 6 faces and can generate a number between 1 and 6.


The minimum number generated by the two dice is 2 and maximum number is 12. Throw the dice and if the number generated is less than or equal to 3 than you lose and if it is greater or equal to 9 than you win and if you get a number between 4-8 then it is a tie. You will make use of Random function and a selection structure (if/else) to write the code.

 

Save the document as Dice4.java.   


 Boyce earns P35.00 per hour at his job. What would be his annual income be if he works 8 hours per day, 5 days per week, and 50 weeks per year? Write a script to support you answer, the script should prompt a user to enter his\her hourly rate, number of hours per day, number of days per week and number of weeks per year. Then the system computes the annual income [10 marks] 


. Write a shell script called Grading.sh that will accept StudentID and Grade and the student are graded using the following grading criteria: 80 and above, Destination, 79-60, Merit, 59 -50, Pass, 49-40, Supplement and 39 and below, Fail. The program should add the records to a file called StudentGrades.txt. [15 Marks]


  1. What is the Difference between MOV AH, 2 and MOV AH, 1
  2. What is the Purpose of "LEA" and MOV AH, 9

Create an Assembly Language Program with the following arithmetic operations.

a.) 2+2-3+1*2-2 = 2

b.) 5-1*2+1-7*2 = 4


Demonstrate the following services in Linux Operating system (15 Marks) i. Configuring Network Services ii. Accessing and Administrating the Remote Desktop iii. Securing Remote Services 


  1. Use the following command to install packages required for DNS:
  2. yum -y install bind-chroot bind-utils
  3. There are some sample files on cntserv in /home/exercises/named-config.tgz.  You can scp them from there to your server and extract them.  HINT: If you are running scp on your system to copy the files down you cannot use the cntserv name unless you made the host file entry in module 6.  If not, you need to use cntserv’s private IP: 192.168.240.103
  4. Extract the sample files from named-config.tgz.
  5. Copy the sample named.conf into /etc.  You will overwrite the existing file.  Modify it for your domain and IP.  Your domain should be abc1234.lab where you use your cntserv username for abc1234.
  6. Copy the sample zone file into /var/named/data.  Modify it for your domain and IP.  Your domain should be abc1234.lab where you use your cntserv username for abc1234.
  7. Start the named service.
  8. Modify the firewall to let the DNS traffic in from any source.

The program displays Five members of the band. The codes for five-star band members are John Lennon, Angus Young, Freddie Mercury, Debbie Harry, and Kurt Cobain are JL, AY, FM, DH, KC respectively.  


LATEST TUTORIALS
APPROVED BY CLIENTS