×
Get Full Access to C++ For Everyone - 2 Edition - Chapter 7 - Problem R7.27
Get Full Access to C++ For Everyone - 2 Edition - Chapter 7 - Problem R7.27

×

# Section 7.6 described an arrangement where each item had a pointer to the user whohad ISBN: 9780470927137 356

## Solution for problem R7.27 Chapter 7

C++ for Everyone | 2nd Edition

• Textbook Solutions
• 2901 Step-by-step solutions solved by professors and subject experts
• Get 24/7 help from StudySoup virtual teaching assistants C++ for Everyone | 2nd Edition

4 5 1 410 Reviews
16
0
Problem R7.27

Section 7.6 described an arrangement where each item had a pointer to the user whohad checked out the item. This makes it difficult to find out the items that a particularuser checked out. To solve this problem, have an array of strings user_names and aparallel array loaned_items. loaned_items[i] points to an array of char* pointers, each ofwhich is a name of an item that the ith user checked out. If the ith user didnt checkout any items, then loaned_items[i] is NULL. Draw a picture of this arrangement.

Step-by-Step Solution:
Step 1 of 3

Day 5 ­fprintf­This function is used to format output ­anything written in single parentheses that becomes a string of text is a string value, or a numerical value see picture below to see the syntax). Example: >> y=input('Enter a number') Enter a number Or >> z = input('Enter Text:','s') Enter Text: ­Syntax:fprintf(format_string, variables) ­if you want to use special characters in the string, put ‘/’ In class exercises: Number 3: >> untitled5 f = @(x)(sin(x)).^2+((cos(x)).^2./(sin(x)­cos(x))) Enter a number x = [] Y = [] >> untitled5 f = @(x)(sin(x)).^2+((cos(x)).^2./(sin(x)­cos(x))) Enter a number[0 pi/8 pi/6 pi/4 pi/2] x = 0 0.3927 0.5236 0.7854 1.5708 Y = 1.0e+15 * ­0.0000 ­0.0000 ­0.0000 ­4.5036 0.0000 2) f=@(x)(sin(x)).^2+((cos(x)).^2./(sin(x)­cos(x))) t=input(‘​Please input a vector of values’​ ); y=f(x) display(x) display(y) ­the thing that makes a function file a function is the word ‘function’ at the start ­run button will not work for a function file. You have to put inputs Exercise: ­Open a new function from the drop down menu function [ y ] = Cube_root( x ) %UNTITLED7 Summary of this function goes here % Detailed explanation goes here y=x.^(1/3); Have to name the file Cube_root as well End (what you input is in black) In the command window: >> z=Cube_root([8 27 84]) z = 2.0000

Step 2 of 3

Step 3 of 3

## Discover and learn what students are asking

Statistics: Informed Decisions Using Data : Data Collection
?In Problems 1–5, provide a definition using your own words. 2. Population

Unlock Textbook Solution