Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

* Comments in your code are required

* Main Program Operation:

 # Your program should first prompt the user for an integer to seed the random number Generator. "Enter an seed integer for random number generator:"

 #  Prompt the user to enter an integer to denote the number of values to create, n. The limit is100 numbers. "How many numbers to create:"

 #  Randomly generate and store the n integer values in the range of [-100,500]. Set argument $a0, the ID of the pseudorandom number generator to 8.

 # Write/Call a function to print the array values to the screen, printArray

 #  Write/Call a function for insertion sort, isort, to sort the values.

 #  Call printArray again to print the sorted values.

 # Prompt the user to enter a filename. "Enter input filename:"

- When reading in a string, the newline character is appended to the end if the string does not fill the buffer. Mars does not allow the newline character to be in the .filenamein order to open a file. You must delete/remove the newline character from thefilename string prior to opening the file (replace it with NULL).

# Use syscall 13 and 14 to open the file and read from the input file. Print error and reprompt forfilename if the file is not found. "Cannot open file." Make sure to open and close each fileproperly.

 # Write/Call a function, abcCount, to count the frequency of each alphabetic character in theinput file text.

 # Print the total number of characters counted.

# Write/Call a function, printTable, to print a table which displays the frequency of each letter.

 # Write/Call a function, ROT47Cipher, to encrypt the input text and print it to the screen.

 #  Prompt the user to enter 'E' to exit or 'R' to repeat the program.

Technical Specification:

The program should contain the following five functions:

 #isort: This function implements the iterative insertion sort algorithm.

* Input parameters: the base address of the array to be sorted, the number of elements in the array

  • Return parameter: Total sum of values sorted.

 

 #printArray: This function should print an array of integers to the screen.

* Input parameter: the base address of the array to be printed, number of elements to print.

* Return parameter: None

 #abcCount: This function examines each character in the text string and increments the countof the character in the array. Ignore any punctuation and spaces. Assume capital andlowercase letters are equivalent.

*   Input parameter: the base address of the array for storing the letter count, the base

address of the text string

* Return parameter: The total number of characters processed

# printTable: This function prints a two column table which displays the letter followed by itsfrequency count.

 

* Input parameter: the base address of the array for the frequency count, the number of

elements to print

  • Return parameter: None

a. ROT47: A substitution cipher in which uses the ASCII table to replace the plaintext withletters, numbers, and symbols. Specifically, the 7-bit printable characters from 0x21 '!' to

0x7E '~' (94 in total) are rotated by 47 positions. No special consideration is taken for

upper case and lower case, and the space character is left intact. For example, 'a' is

mapped to '2' and '9' is mapped to 'h'. (More details can be found here

http://en.wikipedia.org/wiki/ROT13). Note: Spaces are left untouched, but all other visiblesymbols are encrypted.

* Input parameter: the base address of the text string

* Return parameter: None

 # All functions should be called from the main program.

 # You may write additional functions if you choose. However, DO NOT deviate from the abovefunction specifications, redefine the parameters and/or functionality of the functions. Implement the functions and program as described above

  •  Data segment:

#  You should allocate space in your memory to generate at most 100 integer values, space for100,000 characters to be read from the text file, and space for storing the frequency of eachcharacter. Remember if you allocate your space after strings you must realign your memorysuch that the integer values are word aligned. Use the .align directive.

Enter 'E' to exit or 'R' to repeat: E

Testing:

your code must  assemble or operate correctly in MARS.

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M9530807

Have any Question?


Related Questions in Programming Language

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Task working with arraysoverviewin this task you will

Task: Working with Arrays Overview In this task you will create a simple program which will create and work with an array of strings. This array will then be populated with values, printed out to the console, and then, w ...

Question - create a microsoft word macro using vba visual

Question - Create a Microsoft Word macro using VBA (Visual Basic for Applications). Name the macro "highlight." The macro should highlight every third line of text in a document. (Imagine creating highlighting that will ...

Assignment - proposal literature review research method1

Assignment - Proposal, Literature Review, Research Method 1. Abstract - Summary of the knowledge gap: problems of the existing research - Aim of the research, summary of what this project is to achieve - Summary of the a ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Php amp session managment assignment -this assignment looks

PHP & SESSION MANAGMENT ASSIGNMENT - This assignment looks at using PHP for creating cookies and session management. Class Exercise - Web Project: Member Registration/Login This exercise will cover adding data connectivi ...

Task - hand execution of arraysoverviewin this task you

Task - Hand Execution of Arrays Overview In this task you will demonstrate how arrays work by hand executing a number of small code snippets. Instructions Watch the Hand Execution with Arrays video, this shows how to ste ...

1 write a function named check that has three parameters

1. Write a function named check () that has three parameters. The first parameter should accept an integer number, andthe second and third parameters should accept a double-precision number. The function body should just ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As