Goal: Solve the programming problem 3.21 given in the 10th Edition of the book. In this assignment, you will develop a multi-process program that develops the sequence of collatz numbers for a given positive integer n.
Details: The Collatz conjecture concerns what happens when we take any positive integer n and apply the following algorithm:
n={ n/2,if niseven }
3×n+1,if nisodd
The conjecture states that when this algorithm is continually applied, all positive integers will eventually reach 1. For example, if n = 35, the sequence is: 35, 106, 53, 160, 80, 40, 20, 10, 5, 16, 8, 4, 2, 1
You have to write a C program that uses the fork() system call to generate this sequence in the child process. The starting number will be provided from the command line. For example, if 8 is passed as a parameter on the command line, the child process will output 8, 4, 2, 1. Because the parent and child processes have their own copies of the data, it will be necessary for the child to output the sequence. Have the parent invoke the wait() call to wait for the child process to complete before exiting the program. Perform necessary error checking to ensure that a positive integer is passed on the command line.
Report Details: As a part of this assignment you have to prepare a report which will describe the low-level design of your program and give an analysis of its output.
Submission Format
You have to upload: (1) The source code in the following format: Assgn1Src-<RollNo>.c (2) Readme: Assgn1Readme-<RollNo>.txt, which contains the instructions for executing the program.
(3) Report: Assgn1Report-<RollNo>.pdf. Name the zipped document as: Assgn1-<RollNo>.zip
Please follow this naming convention. Otherwise, your assignment will not be graded.
Grading Policy: The policy for grading this assignment will be –
(1) Design as described in report and analysis of the results: 50%; (2) Execution of the tasks based on description in readme: 40% (3) Code documentation and indentation: 10%.
[SOLVED] Operating Assignment 1- Computation of Collatz Numbers
34.99 $
Category: CS3510
Tags: assignment, collatz, computation, numbers, operating, systems–1:
Click Category Button to View Your Next Assignment | Homework
You will receive the following solution file(s) instantly after successful payment:
-
Prog_Assignment_1-ayzb9w.zip
(211.1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
- Prog_Assignment_1-ayzb9w.zip
Related products
Related in this category
More in this category
-

CS 3510 Homework 2
34.99 $ Add to cart -

CS3510 Project 1-Designing Efficient Minesweeper Algorithms
34.99 $ Add to cart -

CS3510 Theory Assignment 1: Chapter 1
39.99 $ Add to cart -

CS3510 Assignment 2-Merge sort using multiple threads
29.99 $ Add to cart -

CS3510 Assignment 3
25.00 $ Add to cart -

CS3510 Homework 5
29.99 $ Add to cart




