Purchase Solution

Shell Script to Convert Students Marks to Grades

Not what you're looking for?

Ask Custom Question

Also I am trying to append my newly created PS1 Command Prompt to a file how do I do that?

Please also Provide the step by step instructions so that I too can try and do these exercises.

Project 6-4
In this project, you will convert pseudo code that uses a decision structure into a shell script. The script then will accept three grades, calculate an average, and then display a letter grade based upon the average. You will need to use either the (if) statement or the (case) statement to implement this script.

1. Log in to the Linux system as a user, and then open a Terminal emulation window.
2. Create a shell script named Project6-4 in your $HOME/bin directory.
3. Convert the following pseudo code into code for the script:
Read in three grades from the keyboard
Average the grades

Display the appropriate letter grade for the number grade using this scale:
90 to 100: Display a letter grade of "A"
80 to 89: Display a letter grade of "B"
70 to 79: Display a letter grade of "C"
65 to 69: Display a letter grade of "D"
0 to 64: Display a letter grade of "F"
Insert appropriate comments

4. Save the script, quit the editor, and then make the script executable.
5. Execute the script and then input 100, 90, and 100 when prompted for each grade.
6. Record the output.
7. Execute the script again. This time input 99, 68, and 70 when prompted for each grade.
8. Record the output.
9. Execute the script one last time. Input 80, 96, and 72 when prompted for each grade.
10. Record the output.
11. Close your window, and then log out.

Attachments
Purchase this Solution

Solution Summary

Explains in detailed steps how to accept three marks, calculate average and then find the appropriate letter grade from the calculated average.

Solution Preview

#Also I am trying to Append my newly created PS1 Command Prompt to a file how do I do that?
## once you have created your PS1, you can append the PS1 variable to a file "myfile"
echo $PS1 >> myfile

#Now the script...
#1. Log in to the Linux system as a user, and then open a Terminal emulation window.
#It's obvious
#2. Create a shell script named Project6-4 in your $HOME/bin directory.
joe Project6-4.sh
#3. Convert the following pseudo code into code for the script:
#Read in three grades from the keyboarddeclare -i x
declare -i y
declare -i z
declare -i avg

#3. Convert the following pseudo code into code for the ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Networking Questions

This quiz consists of some basic networking questions.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.