Free Essay

Sequential Process

In:

Submitted By bblester
Words 605
Pages 3
Axia College Material
Appendix G Sequential and Selection Process Control Structure
In the following example, the second line of the table specifies that tax due on a salary of $2000.00 is $225.00 plus 16% of excess salary over $1500.00 (that is, 16% of $500.00). Therefore, the total tax is $225.00 + $80.00, or $305.00.

Salary Range in Dollars
1 2 3 4 5

Base Tax in Dollars 0.00 225.00 465.00 825.00 1425.00

Percentage of Excess 15 % 16 % 18 % 20 % 25 %

0.00-1,499.99 1,500.00-2,999.99 3,000.00-4,999.99 5,000.00-7,999.99 8,000.00-14,999.99

Main Module Declare Associate_Name as string Declare Salary_Amount as real Declare Base as real Declare Excess as real Declare Salary as real Declare Start_Over as string REM these are the calls for the modules that can be ran. Not all modules will run REM because associates will only fall into 1 tax bracket Call Input Data Module Call Range Module

IT 210

Call Salary1 Module Call Salary2 Module Call Salary3 Module Call Salary4 Module Call Salary5 Module Call Output Module End Main Module Input Data Module Write, “Please Enter Associate’s Full Name” Input Associate_Name Write, “Associates Salary Amount?” Input Salary_Amount Call Range Module End Input Data Module Range Module

REM these statements (if, then, else) will determine what module to call upon. If Salary_Amount < 1,499.99 Then Call Salary1 Module Else If Salary_Amount > 1,500.00 AND Salary_Amount < 2,999.99 Then Call Salary2 Module Else If Salary_Amount > 3,000.00 AND Salary_Amount < 4,999.99 Then Call Salary3 Module

IT 210

Else If Salary_Amount > 5,000.00 AND Salary_Amount < 7,999.99 Then Call Salary4 Module Else If Salary_Amount > 8,000.00 AND Salary_Amount < 14,999.99 Then Call Salary5 Module Else Write,” The salary you typed in is not computable.“ Write,” Please enter a salary between 0.00 and 14,999.99.” Call Input Module End Range Module Salary 1 Module Declare Excess as real Declare Salary as Real Set Excess = Salary_Amount * .015 Set Salary = Salary_Amount - Excess Call Output Module End Salary 1 Module Salary 2 Module Declare Base as real Declare Excess as real Declare Salary as real Set Base = Salary_Amount - 225 Set Excess = Base * .16 Set Salary = Base - Excess Call Output Module End Salary 2 Module Salary 3 Module

IT 210

Declare Base as real Declare Excess as real Declare Salary as real Set Base = Salary_Amount - 465 Set Excess = Base * .18 Set Salary = Base - Excess Call Output Module End Salary 3 Module Salary 4 Module Declare Base as real Declare Excess as real Declare Salary as real Set Base = Salary_Amount - 825 Set Excess = Base * .20 Set Salary = Base - Excess Call Output Module End Salary 4 Module Salary 5 Module Declare Base as real Declare Excess as real Declare Salary as real Set Base = Salary_Amount - 1425 Set Excess = Base * .25 Set Salary = Base - Excess Call Output Module End Salary 5 Module

Output Module Declare Start_Over as string Declare Associate_Name as string Declare Salary as real

IT 210

Write,” The gross salary for,” Associate_Name Salary Write, “Wanna start this from the beginning? Enter Y or N” Input Start_Over If Start_Over = “Y” or “y” Then Call Input Module Else If Start_Over = “N” or “n” Then End Else Write, “Cannot Computer Your Answer, Shutting Down.” End End Output Module Input Test Values: Associate_Name: Cody Johnson Salary: 10,150.00 The gross salary for Cody Johnson 6543.75 Associate Name: Matthew Johnson Salary: 5000.00 The gross salary for Matthew Johnson 3340

IT 210

Similar Documents

Free Essay

Operating Systems Assignment 1

...Updates and IOS update mechanism is ITunes. Chapter 2 2. What is the main advantage for an operating-system designer of using a virtual-machine architecture? What is the main advantage for a user? (10 points) Answer) OS designers can solve debug, network problem and security problem easily. Users also can undergo many different OS on one physical system. It is easy to research and develop. Chapter 3 3. Discuss three major complications concurrent processing adds to an OS. (10 points) Answer) 1. Processes and system resources should protected from each other. 2. More than one process executing concurrently for protect performance degradation 3. It occurs deadlocks. So you can m Chapter 4: 4. Provide a programming example where multithreading does not provide better performance than a single-threaded solution. (5 points) Answer) Sequential program is not good at threaded. So example is Shell program. 5. Can a multithreaded solution using multiple user-level threads achieve better performance on a multiprocessor system than on a single-processor system? How does this change if kernel-level threads are used? Explain. (10 points) Answer) multiple user-level threads cannot make different processors in multiprocessor system at the same time. So, it shows lower performance. But If change kernel-level threads, it can make different processors at the same time. It is good at multiprocessor system Chapter 5 complications 6. Discuss how...

Words: 662 - Pages: 3

Free Essay

Swear as Mechanism to Pain

...Chapter 2 OPERATING SYSTEM CONCEPTS SYS-ED/ Computer Education Techniques, Inc. Solaris System Administration: Introduction Operating System Concepts Objectives You will learn: • Operating system components. • Solaris usage of processes. • File management and file systems. • Use of the Solaris Management Console. SYS-ED/COMPUTER EDUCATION TECHNIQUES, INC. (Solaris – System Admin: Intro - 6.5) Ch 2: Page i Solaris System Administration: Introduction 1 Operating System Concepts Operating System: Definition An operating system is the set of programs that controls a computer. The core of the operating system is the kernel. The kernel is a control program that functions in privileged state that allows all hardware instructions to be executed. It reacts to interrupts from external devices and to service requests and traps from processes. The kernel creates and terminates processes and responds to requests for service. Operating systems are resource managers. The main resource is computer hardware in the form of processors, storage, input/output devices, communication devices, and data. Operating system functions include: • Implementing the user interface. • Sharing hardware among users. • Allowing users to share data among themselves. • Preventing users from interfering with one another. • Scheduling resources among users. • Facilitating input/output. • Recovering from errors...

Words: 2421 - Pages: 10

Free Essay

Operating System Concepts

...Operating system concepts(Seventh edition) 2008.3 solutions to the exercises Chapter 1 1.1 In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. a. What are two such problems? b. Can we ensure the same degree of security in a time-shared machine as in a dedicated machine? Explain your answer. Answer: a. Stealing or copying one’s programs or data; using system resources (CPU, memory, disk space, peripherals) without proper accounting. b. Probably not, since any protection scheme devised by humans can inevitably be broken by a human, and the more complex the scheme, the more difficult it is to feel confident of its correct implementation. 1.2 The issue of resource utilization shows up in different forms in different types of operating systems. List what resources must be managed carefully in the following settings: a. Mainframe or minicomputer systems b. Workstations connected to servers c. Handheld computers Answer: a. Mainframes:memory and CPU resources, storage, network bandwidth. b. Workstations: memory and CPU resouces c. Handheld computers: power consumption, memory resources. 1.3 Under what circumstances would a user be better off using a timesharing system rather than a PC or single-user workstation? Answer: When there are few other users, the task is large, and the hardware is fast, time-sharingmakes sense. The full power of the system can be brought to bear on the...

Words: 26526 - Pages: 107

Premium Essay

Os Final

...Who is the creater of CP/M? [Kildall] Who is the head of the Multics project. [Carbato] Which OS’s process scheduler reduces priority and increases quantum. [CTSS] Which one is the difference between a semaphore and monitor. [Last choice] If a system has 16 drives and each process can have 4 drives. What is the maximum number of n that the system is deadlock free. [5] Given the sequence below which processes will cause a page fault. (for FIFO – LRU) Write a loop that would create 10 child processes. (No more than 10). If a file is shared by two processes, can have read-only and the other read-write access. If yes how, if not what prevent it. What are some of the security features in UNIX or NT. How does NTFS directory system work. How does UNIX directory system work. Pick a Unix UNIX process scheduler and explain how (not why or when) it favors I/O bound processes to CPU bound processes. Explain and compare I/O software (programmed, interrupt, DMA). What is the problem with RAID4 and explain how RAID5 solves the problem. Disk arm scheduling algorithms readuce read time but what does Linux additionally do. How does Workingset Clock algorithm work. If seektime is 8msec and each track is 160KB. What is the access time to read 4KB. Couffman listed four requirements for a deadlock. Describe fourth one and how to prevent it. What are the advantages of inverted page tables. What is a soft link. Implement soft link and hard links...

Words: 278 - Pages: 2

Free Essay

Comp3511 Hw1 Solution

...Fall 2011 COMP 3511 Homework Assignment #1 Solution Handout Date: Sept. 22, 2011 Due Date: Oct. 6, 2011 Name: ______________ ID: ___________________ E-Mail: _____________ COMP 3511 L __ Please read the following instructions carefully before answering the questions:  You should finish the homework assignment individually.  There are a total of 4 questions.  When you write your answers, please try to be precise and concise.  Fill in your name, student ID, email and Section number at the top of each page. Submissions without this information will be discarded.  Please fill in your answers in the space provided, or you can type your answers in a Word file.  Homework Collection: the hardcopy is required and the homework is collected at the collection box (#6, #7) or in class. (22 points) Please answer the following question in 2-3 sentences 1) (8 points) What is the benefit of Direct Memory Access (DMA)? Is interrupt still needed when a DMA is used? Can DMA operations possibly interfere with CPU operations? 1. Answer: This frees up the CPU during I/O operation, so the CPU can be better used; Or to improve the CPU utilization (3 points). Interrupt is still needed when the DMA operation is completed in order to inform the CPU (2 points). If a DMA and CPU access memory at the same time, it can interfere with each other (3 points). 2) (4 points) Why is it necessary to separate user mode and kernel mode? Answer: This provides some level of protection so that user programs...

Words: 1136 - Pages: 5

Premium Essay

Case Study Vodacom

...UNDERSTANDING THREADS Simply put, a thread is a program's path of execution. Most programs written today run as a single thread, causing problems when multiple events or actions need to occur at the same time. Let's say, for example, a program is not capable of drawing pictures while reading keystrokes. The program must give its full attention to the keyboard input lacking the ability to handle more than one event at a time. The ideal solution to this problem is the seamless execution of two or more sections of a program at the same time. Threads allow us to do this. A process is essentially a "heavy" unit of multitasking: as an approximation, think of it as an "application" (though it can include 'background' or 'system' processes such as your battery monitor, mouse and keyboard server, PDA synchronization tool etc). A thread, on the other hand, is a more "lightweight" unit.  Threads are can be seen essentially sub processes. Informally, we can think of them as tasks that belong to a program and that can run "simultaneously". For them to run simultaneously, each of these two tasks will run in a separate thread. Depending on the number of CPUs available and the number of competing threads, some of those threads actually will run in parallel on different CPUs, whilst in other cases the illusion of simultaneous execution will be achieved by "juggling" threads in and out of the available CPUs. A part of the OS called the thread scheduler takes care of deciding...

Words: 1652 - Pages: 7

Premium Essay

Pm 586

...Chris and Pat Smith, and Martin and Miller decided it was best to have a termination contact set in place to secure all partakers in their final decisions. They noted it was best for all to have precise, clear explanations all of all essential fundamentals for the termination of their business partnership. An acknowledgement of the effective termination date would need to be set, and all potential risks, if any, should be stated for all parties. The owners and the chefs would meet for a period of 30 minutes and try to dissolve their partnership. The owners and the chefs blame each other for the failure of At Your Service; however, all partakers should act as responsible, mature adults during the meeting. It would speed up the termination process; especially if all partakers can...

Words: 368 - Pages: 2

Premium Essay

Case Study

...Case Study Tresa Jellison HCS/483 November 12, 2012 Dr. Kaderie Case Study The basic IT implementation process is the whole process of setting up and running an IT based program for a company. It starts from the beginning to the end of the process and throughout the whole process even after the last step has been taken. You have the planning stage, and this will include what exactly what you are looking for and what you want the program to do and how it will operate. Who will be using this program and who will it be beneficial to. You will have to go and get bids or quotes from companies that can provide this type of service. Depending on what is being implemented you have to do weeks, months and even years of research to ensure that the program will benefit everyone involved and that time and money is not being wasted. A lot of the things that were done are this analysis did not follow the fundamentals of implementation. During the execution of the program there where many bugs that had to be fixed that could have been prevented if the right questions and queries where ran before going live. There should have been a trial or practice run before the whole system went live. And they should have not done it at all of the sites. Only a couple of the sites should have had the program and should have been using it to get the bugs out. There were way off budget and there were a lot of hidden details that should have been reported. At least this way there would have...

Words: 581 - Pages: 3

Free Essay

Lab 4.1: Using Linux Command-Line Basics

...Labs Lab 4.1: Using Linux Command-Line Basics What is the purpose? This lab demonstrates how to redirect data from a process and how to identify and kill a process. What are the steps? • Task 1: Redirecting and piping standard output Procedure 1. Obtain a list of files from the home directory, including the hidden files. Redirect the output to a file named Listing by using the ls -a > listing command. 2. Obtain a long list of files, including the hidden files, and append the output to the same file. 3. Use the cat listing | less command to view the file and pipe the output to less. 4. Use the cat command to view the file again. However, this time, pipe the output to lpr to print the file. 5. Redirect the output of ls to the special file /dev/null. What happens? It’s redirected to dev/null Why? It’s null. • Task 2: Putting tasks in the background and terminating the job Procedure 1. Use the tail –f command to view your listing file from the previous task. The –f option tells tail to follow changes; therefore, the file will continue to run this command until you cancel the command by pressing Ctrl+C. Put the file in the background using the tail -f listing & command. You may need to press Enter again to view the command prompt. 2. Put the process in the background and display the prompt again. Run the top command in the foreground. This will provide you a list of your top 20 processes by CPU usage. Put this list in the background and stop it by pressing...

Words: 780 - Pages: 4

Free Essay

Unix/Linux vs. Mac vs. Windows

...are compared. Process Management, File Management, Memory Management, and Security are going to be compared between Windows, Linux, UNIX, and Mac operating systems. Every operating system is different and is interesting to see how every piece of software has the same outcome but has different procedures in between. Process management is defined as how the OS manages multiple programs running at the same time. A thread is a feature of an OS that enables parallel processing within a single process. UNIX, Windows, and Mach are all multitasking systems that support both processes and threads. They can be compared in several respects with regard to the process management features. When executing a program on UNIX, the system creates an environment for that program. In this setting there is everything needed to execute that program. The OS tracks processes though a five digit number Recognized as the Process ID. Each process has its own unique PID. PID’s ultimately repeat because all the probable numbers are used, and the next PID repeats the system again. At any time, no two Processes with the same PID occur in the system, because it is the PID that UNIX uses to track its processes. Each UNIX process has two ID numbers. The PID or process ID, and PPID or Parent process ID. Each user process in the system has a PPID. Normally, when a child process is killed, the parent process is told by a SIGCHLD signal. Then the parent can do another task, or restart a new process as needed. When...

Words: 452 - Pages: 2

Premium Essay

Synthesis Essay

...When being ask a question in today’s society, the automatic answer or reaction in order find a solution would be through the use of technology. We as the people have grown dependent on the world of the Internet, the accessibility of our phones and uses of clocks. A thought that we find hard to comprehend is that just about thirty years ago some of these tools did not exist. How has technology affected our minds and the way we think or even process information? Can we say we have turned our brains into a living computer, or are so dependent on outside answers that we have stopped thinking for ourselves? Now and days we have entered a state of obliviousness on how little knowledge and wisdom we truly have. It is very interesting to think about on how technology especially the television could affect our attention span and the information that is being given to us. In Postman’s “Amusing Ourselves to Death” he states a precise point “the average length of a shot on network television is only 3.5 seconds, so that the eye never rests, always has something to see” (86). This statement alone shows and proves on how peoples attention span is constantly shifting and changing focus to see what else is there is to see or what is next to come. As the Internet becoming more useful to people, written stories or narratives are becoming more extinct. In the article “The Transition to Digital Journalism” the author Paul Grabowicz’s stated, “Younger people in particular are said...

Words: 1235 - Pages: 5

Free Essay

Linux

...SYSTEM Thread of execution is the smallest sequence of programmed instructions that can be managed independently by an operating system scheduler. The scheduler itself is a light-weight process. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process. Multiple threads can exist within the same process and share resources such as memory, while different processes do not share these resources. In particular, the threads of a process share its code and its context . On a single processor, multithreading is generally implemented by time-division multiplexing (as in multitasking): the processor switches between different threads. This context switching generally happens frequently enough that the user perceives the threads or tasks as running at the same time. On a multiprocessor or multi-core system, threads can be truly concurrent, with every processor or core executing a separate thread simultaneously. Many modern operating systems directly support both time-sliced and multiprocessor threading with a process scheduler. The kernel of an operating system allows programmers to manipulate threads via the system call interface. Some implementations are called a kernel thread, whereas a lightweight process (LWP) is a specific type of kernel thread that shares the same state and information. Threads are created like normal tasks, with the exception that the clone() system call...

Words: 993 - Pages: 4

Free Essay

Os Study Guide

...COMP3361 Operating Systems I Mid-­term Review and Study Guide Basic Concepts: What is an operating system? A program that acts as an intermediary between a user of a computer and the computer hardware - basic functions? 1.) OS is a resource allocator 2.) manages all resources 3.) decides between conflicting requests for efficient and fair resource use 4.) OS is a control program 5.) controls execution of programs to prevent errors and improper use of the computer 6.) a program running at all times on the computer, usually called the kernel 7.)everything else is either a a.) system program: associated with the OS but not part of the kernel b.) application program: not associated with the OS user/kernel modes of operation? 1.) The operating system must ensure correct operation of the computer system. To prevent user programs from interfering with the proper operation of the system, the hardware has two modes: user mode and kernel mode. Various instructions (such as I/0 instructions and halt instructions) are privileged and can be executed only in kernel mode. 2.) Kernel Mode In Kernel mode, the executing code has complete and unrestricted access to the underlying hardware. It can execute any CPU instruction and reference any memory address. Kernel mode is generally reserved for the lowest-level, most trusted functions of the operating system. Crashes in kernel mode are catastrophic; they will halt the entire PC. 3.) User Mode In User mode...

Words: 2427 - Pages: 10

Free Essay

Littlefield

... 5 | donothing | 588,054 | 6 | mas001 | 472,296 | Exhibit 1 : OVERALL TEAM STANDING Decisions Made A summary of the rationale behind the key decisions made would perhaps best explain the results we achieved. . Decision 1 Day | Parameter | Value | 54 | station 1 machine count | 2 | When the exercise started, we decided that when the lead time hit 1 day, we would buy one station 1 machine based on our analysis that station 1 takes the longest time which is 0.221 hrs simulation time per batch. (Exhibit 2: Average time per batch of each station). As day 7 and day 8 have 0 job arrivals, we used day 1-6 figures to calculate the average time for each station to process 1 batch of job arrivals. Base on the average time taken to process 1 batch of job arrivals, we were able to figure out how many batches each machine can handle. day | number of jobs arriving each day | utilization of station 1, averaged over each day | utilization of station 2, averaged over each day | utilization of station 3, averaged over each day | 1 | 2 | 0.433 | 0.079 | 0.019 | 2 | 2 | 0.272 | 0.158 | 0.108 | 3 | 1 | 0.398 | 0.106 | 0.165 | 4 | 0 | 0 | 0.052 | 0 | 5 | 2 | 0.33 | 0.079 | 0.06 | 6...

Words: 1324 - Pages: 6

Free Essay

The Worst Discipline

...children are constantly disobedient, acting out at school or in public places, it makes the parent look bad and feel bad. At times, an anxious child likes to stick things in his or her pockets that do not belong to him or her or the child do not like to share things, when the time is appropriate. When out of control a child tends to talk back often trying to push the parent’s limits. After being loud, out of control and defiant continuously after being warned about a problem or punished in a less severe way repeatedly before actually being spanked, If the child still does not want to be obedient after the necessary steps have been taken then they should receive a more severe discipline such as a spanking. The process of spanking is a very agonizing and tormenting process. The child would suffer first by being forced to listen to a long lecture, instead of just receiving the spanking. Knowing what was coming after the speech brought a lot of fear and anxiety. It felt as if his or her stomach started cramping and his or her heart's would stop pumping at any moment during the lecture. As the time approached for the spanking, fear and nervousness grew rapidly .The...

Words: 588 - Pages: 3