Purchase Solution

Write a shell script that prints the following menu (Unix)

Not what you're looking for?

Ask Custom Question

Write a shell script that prints the following menu
Welcome to My Simple Mathematica
a) Choose 'a' for Fibonacci Series
b) Choose 'b' for Prime Numbers

Please make your choice [a or b]:
Once the user enters 'a' or 'b' perform the appropriate calculation and print the series. Limit the series by requiring the user to provide the upper limit number.
After printing the series prompt the user if they wish to continue. A positive response (Yes) prints the menu again, and a negative response (no) exits the program.

generate 7 fibonacci numbers i.e. 1 1 2 3 5 8 13

Purchase this Solution

Solution Summary

The expert writes a shell script that prints a menu for Unix.

Solution Preview

This is written in bash. It wouldn't take too much effort for you to convert it to csh if thats what you need.

#!/bin/bash

function fibonacci {
# This is implemented with the limit as the highest value to obtain.
# The question was ambiguous about whether this was supposed to be a
# limit or a count. Changing it to a count is very straightforward.

first=0
second=1

...

Purchase this Solution


Free BrainMass Quizzes
Basic Networking Questions

This quiz consists of some basic networking questions.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

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.

Javscript Basics

Quiz on basics of javascript programming language.

C# variables and classes

This quiz contains questions about C# classes and variables.