Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092997
Author: Bryant
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 8, Problem 8.21HW
What are the possible output sequences from the following
____________________________________code/ecf/waitprob3.c
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Which file system(s) in Microsoft's Windows operating system support 16-bit Unicode filenames?
Can you see where I did wrong in this program ?
They show in compiler : ar@osboxes:~
Documents/C++/Project/Projekt_alternativ/"try5/usr/bin/ld: /tmp/ccvECf7h.o: in function `add()':try5.cpp:(.text+0x502): undefined reference to `WriteToFile()'collect2: error: ld returned 1 exit status
The program :
#include<iostream>#include <fstream>#include<string>using namespace std;#define M 100int count=0;struct AddressBook{string FullName;int Birthday;string Address;string Email;int PhoneNumber;}Person [M];void WriteToFile();void add();void browse();void searchByName();void searchByBirthday();void removeContact();void order();int main(){fstream file;file.open("Contact'sBook.txt");int choice;do{cout << "Please Enter Your Choise: \n";cout << " 1-Add New Person\n 2-Browse\n 3- Search By Full Name \n 4- Search By Birthday 5- Remove a Person" << "\n6- Alphabetical Order \n7-Exit\n";cin >> choice;switch(choice){case 1: add();case 2: browse();break;case 3:…
I ran the updated code that you provided.
This is my output:
-2147483648100
This is the updated code that you provided:
.data .globl main .textmain: # compute the next state of the LFSR for each input state li $a0, 0x00000001 jal lfsr_next_state move $t0, $v0 li $a0, 0xdeadbeef jal lfsr_next_state move $t1, $v0 li $a0, 0x200214c8 jal lfsr_next_state move $t2, $v0 li $a0, 0x00000000 jal lfsr_next_state move $t3, $v0
# print the output states li $v0, 1 move $a0, $t0 syscall li $v0, 1 move $a0, $t1 syscall li $v0, 1 move $a0, $t2 syscall li $v0, 1 move $a0, $t3 syscall
# exit the program li $v0, 10 syscall
# Function to compute the next state of an LFSR# Input parameter: $a0 = current state# Output: $v0 = next statelfsr_next_state: # Initialize upper mask…
Chapter 8 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 8.2 - Prob. 8.1PPCh. 8.4 - Prob. 8.2PPCh. 8.4 - Prob. 8.3PPCh. 8.4 - Prob. 8.4PPCh. 8.4 - Practice Problem 8.5 (solution page 797) Write a...Ch. 8.4 - Practice Problem 8.6 (solution page 797) Write a...Ch. 8.5 - Practice Problem 8.7 (solution page 798) Write a...Ch. 8.5 - Prob. 8.8PPCh. 8 - Prob. 8.9HWCh. 8 - In this chapter, we have introduced some functions...
Ch. 8 - How many hello output lines does this program...Ch. 8 - How many "hello' output lines does this program...Ch. 8 - Prob. 8.13HWCh. 8 - How many hello output lines does this program...Ch. 8 - How many "hello lines does this program print?Ch. 8 - Prob. 8.16HWCh. 8 - Prob. 8.17HWCh. 8 - Consider the following program: Determine which of...Ch. 8 - How many lines of output does the following...Ch. 8 - Use execve to write a program called my1s whose...Ch. 8 - What are the possible output sequences from the...Ch. 8 - Write your own version of the Unix system function...Ch. 8 - One of your colleagues is thinking of using...Ch. 8 - Modify the program in Figure 8.18 so that the...Ch. 8 - Write a version of the fgets function, called...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
True or False: A static member method may refer to nonstatic member variables of the same class at any time.
Starting Out with Java: Early Objects (6th Edition)
A NOR gate can be considered as an OR gate followed by an inverter.
Digital Fundamentals (11th Edition)
Lottery Winners Modification Modify the program you wrote for Programming Challenge 2 (Lottery Winners) so it p...
Starting Out with C++ from Control Structures to Objects (9th Edition)
The ____________ is always transparent.
Web Development and Design Foundations with HTML5 (8th Edition)
Give an output statement that will produce the following message on the screen: The answer to the question of L...
Problem Solving with C++ (9th Edition)
Given that y=ax3+7, which of the following are correct Java statements for this equations? int y = a x x x +...
Java How To Program (Early Objects)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- How can I modify this C script so that instead of a single character d or w, it takes the specific string "Delta" or "Wye" as user input to choose either option in the script? I believe the only header that should need to be added is string.h, please don't add anything else I won't be able to use it. My script: #include<stdio.h>#include<math.h>int main(){//4. Prompt the user for repetition of the process.char ch = 'y';char network='a';float za,zb,zc,zac,zbc,zcc,z1,z2,z3,z1c,z2c,z3c;float zaxb,zbxc,zaxc,zd,zdc,z1z3,z1z2,z2z3;float zaxbc,zbxcc,zaxcc,z1z3c,z1z2c,z2z3c,zt,ztc;while(ch=='y' || ch=='Y'){//1. ask the user whether it is a Delta or Wye network.printf("\nWhat kind of network? Enter D for delta or W for Wye network:\n\n");scanf("%s",&network);//2. ask the user to type in values (for impedances)//3. make the conversion (Delta to Wye or Wye to Delta)//Delta Network ==> Wyeif(network=='d'||network=='D'){printf("\nWhat are the real values of the impedances…arrow_forwardin c++,with respect to various file streams and modes,answer the following questions a. what is the difference between ios::ate and ios::app? b. ios::trunc is similar to ios:out. state true or false justify c. explain the syntax of seekg function with example? d. write the meaning of the following syntax fstream myFile("test.txt",ios::in|ios::out|ios::trunc): e. state if the below code will execute or not?state the reasons ofstream outfile; outfile.open("name1.txt"); outfle.open("name2.txt"); outfile.close();arrow_forwardcan you please do it on dev c++ , it's C programmingarrow_forward
- Book reference: Windows PowerShell Step by Step 3rd Edition - Ed WilsonSubj: PWS0 - PowerShell Chapter 5 13. What are the two categories of variables in PS? 14. What are some of the types and uses of automatic variables in PS? 15. Name two common data types in PS. 16. What is the reason for the below error? [INT]$R = 10 $R = "Ten" Cannot convert value "Ten" to type "System.Int32". Error: "Input string was not in a correct format." At line:2 char:1 + $R = "Ten" + ~~~~~~~~~~ + CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException + FullyQualifiedErrorId : RuntimeException 17. How would you create a constant data type using the set-Variable cmdlet?arrow_forwardI know it is a pain but I am looking for a kind stranger to add comments within the below C++ code, that explains what each line of code is doing. Please and Thank you C++ Source code: #include <iostream> #include <fstream> using namespace std; int main() { string input; ofstream outFile; outFile.open("CSC450_CT5_mod5.txt", ios::app); if (outFile.is_open()) { cout << "Enter a string to be stored in the file: "; getline(cin, input); outFile << input << endl; outFile.close(); } else { cout << "Error opening file" << endl; } ifstream inFile; ofstream outFile2; inFile.open("CSC450_CT5_mod5.txt"); outFile2.open("CSC450_mod5-2.txt"); if (inFile.is_open() && outFile2.is_open()) { string line; while (getline(inFile, line)) { outFile2 << line << endl; } inFile.close(); outFile2.close(); } else { cout << "Error opening file" << endl; } string reverse; ifstream inFile2; ofstream outFile3;…arrow_forwardWhat is an example of a proper use of one of these utilities: sort, uniq, cut, paste in Ubuntu ? Show syntax and output.arrow_forward
- python homerwork Select the correct script to write 'Hello!' in the file sample.txt for the command line argument python myscript.py sample.txt Hello!? a. f = open(sys.argv[2], 'w') f.write(sys.argv[3]) f.close() b. f = open(sys.argv[1], 'a') f.write(sys.argv[2]) f.close() c. f = open(sys.argv[2], 'w') f.write(sys.argv[1]) f.close() d. f = open(sys.argv[1], 'r') f.write(sys.argv[2]) f.close()arrow_forwardPlease I need Bsupport quick.arrow_forwardI can't run my C++ because of this error. How to fix this? jGRASP wedge error: command "g++" not found. ---- This command must be in the current Working directory ---- or on the current PATH to use this function. ---- working directory is "C:\Users\ACER\Documents\c++". ---- PATH is ";C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\TXE Components\TCS\;C:\Program Files\Intel\TXE Components\TCS\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\TXE Components\DAL\;C:\Program Files (x86)\Intel\TXE Components\DAL\;C:\Program Files\Intel\TXE Components\IPT\;C:\Program Files (x86)\Intel\TXE Components\IPT\;C:\Program Files (x86)\QT Lite\QTSystem;C:\cygwin64\bin;C:\cygwin\bin;C:\MinGW\bin;C:\GNUstep\mingw\bin;C:\Borland\BCC55\Bin;C:\DJGPP\BIN". ----jGRASP: operation complete.arrow_forward
- I am still getting the wrong output with the updated code with the fix. This is the updated coded that you provided: .data .globl main .textmain: # compute the next state of the LFSR for each input state li $a0, 0x00000001 jal lfsr_next_state move $t0, $v0 li $a0, 0xdeadbeef jal lfsr_next_state move $t1, $v0 li $a0, 0x200214c8 jal lfsr_next_state move $t2, $v0 li $a0, 0x00000000 jal lfsr_next_state move $t3, $v0 # print the output states li $v0, 1 move $a0, $t0 syscall li $v0, 1 move $a0, $t1 syscall li $v0, 1 move $a0, $t2 syscall li $v0, 1 move $a0, $t3 syscall # exit the program li $v0, 10 syscall # Function to compute the next state of an LFSR# Input parameter: $a0 = current state# Output: $v0 = next statelfsr_next_state: # Initialize upper mask with…arrow_forwardI ran the updated code that you provide with li $v0, 34 for printing an unsigned integer. I got an error saying: Unknown system call: 34 This the the updated code that you provided: .data .globl main .textmain: # compute the next state of the LFSR for each input state li $a0, 0x00000001 jal lfsr_next_state move $t0, $v0 li $a0, 0xdeadbeef jal lfsr_next_state move $t1, $v0 li $a0, 0x200214c8 jal lfsr_next_state move $t2, $v0 li $a0, 0x00000000 jal lfsr_next_state move $t3, $v0 # print the output states li $v0, 34 # set system call for printing unsigned integer move $a0, $t0 syscall move $a0, $t1 syscall move $a0, $t2 syscall move $a0, $t3 syscall # exit the program li $v0, 10 syscall # Function to compute the next state of an LFSR# Input parameter: $a0 = current state# Output: $v0 =…arrow_forwardYou can download; restadata.txt : https://dosyam.org/2D1j/restdata.txt restaurant.c :https://dosyam.org/2D1i/restaurant.c Given code should be modify in C Language. Can someone help me please ? #include <stdio.h> // Do not edit these directives or add another.#include <stdlib.h>#include <string.h>#include <time.h> #define MAX 1000 // Do not edit this macro. typedef struct // Do not edit this struct.{unsigned long restaurant_id;char restaurant_name[15];char description[127];double rate;char cuisine[31];unsigned short opening_year;unsigned long capacity;char city[31];char address[63];char owner[31];} RECORD_t, *RECORD; /* DECLARE YOUR FUNCTION PROTOTYPES HERE. */void find_by_opening_year(unsigned short opening_year, RECORD *restaurant_array, unsigned long size, unsigned long start, unsigned long end, unsigned long *p_found_num, RECORD **p_found_restaurants);RECORD find_by_restaurant_name(char *restaurant_name, RECORD *restaurant_array, unsigned long size,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.Computer ScienceISBN:9781337569798Author:ECKERTPublisher:CENGAGE L
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:9781337569798
Author:ECKERT
Publisher:CENGAGE L
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License