CP4P_NumberSystems_Activity_Answers 4
docx
keyboard_arrow_up
School
Seneca College *
*We aren’t endorsed by this school
Course
101
Subject
Mechanical Engineering
Date
Feb 20, 2024
Type
docx
Pages
5
Uploaded by CaptainLobsterPerson1059
WORD TABLE OF
CONTENT &BIB
Assignment 3
ABSTRACT
Assignment 3 due date 4th February 2024
joaminu@myseneca.ca
CPR101
Number Systems Activity
Computer Principles for Programmers
TABLE OF CONTENT
Exercise
one
of
two-integer
overflow…………………………………………………………………………2
Exercise
two
of
two-Numbering
systems
and
conversions……………………………3
FALL 2023 WEEK 4
1 of 5
Number Systems Activity
Computer Principles for Programmers
AMINU JIM OLUWAFERANMI
131301236 joaminu@myseneca.ca
@mySeneca.ca
good day prof here is my work
There are many notes in the instructions to help you earn marks for the questions below.
Exercise One of Two
–
integer overflow
(80 points)
1. (5 points) Using your student number as the number of seconds
,
how many days
will it take until that value is reached? (to two decimal places)
1519.69
2. (20 points) Using your student number as the number of seconds
,
how much time
would that represent? 4.16 1519.69
36472.57
2188353.9
3
131301236
YEARS
DAYS
HOURS
MINUTES
SECONDS
3. (5 points) What are the maximum and minimum values that can be stored in a short
16-
bit signed integer? 16-bit signed integer maximum = 32767
… minimum = −32768.
4. (5 points) Give examples of two short
16-bit signed integers that when added together would cause overflow. 17000 + 16000 are two positive values causing overflow when added together. -17000 + -16000 are two negative values causing overflow when added together. Binary Search Bug
5)
(10 points) What is potentially wrong with the (low + high) / 2 calculation to find the
middle point? Under what conditions would the calculation go wrong?
This calucation leads to an overflow which leads to inaccuracy of results
FALL 2023 WEEK 4
2 of 5
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Number Systems Activity
Computer Principles for Programmers
6)
(10 points) REWRITE the
mid
calculation to prevent overflow
from
mid = (low + high) / 2;
to
mid = low + (high-low) / 2
;
7)
(25 points)
Write a 250+ word “reflection”(similar to a workshop in your programming class) describing the steps you used to develop and test your solution to the calculation bug. The initial calculation formular mid = (low + high) / 2 is noted to be inaccurate as it causes overflow the correct formular which is mid = low + (high-low) / 2 increases accuracy and reduces the possibility of having a over flow underflow. When the formular was used for different
testing senerios like using big positive integers and negative integers there was a more accurate
representation of the final result hence reducing overflow and underflow.
Exercise Two of Two
–
Numbering Systems and Conversions
(20 points)
8)
(5 points ) Fill in this chart as per the column headings
Red
decimal
Green
decimal
Blue
decimal
Hex triplet
192
255
238
COFFEE
126
164
112
#7EA470
186
187
30
BABB1E
208
13
30
D00D1E
15
245
231
#0FF5E7
9)
(15 points)
Fill in this chart as per the column headings
Hex triplet
Red
decimal
Green
decimal
Blue
decimal
Change each row's Font or Shading
colour to match the RGB value
#3A26F2
58
38
242
Font or Shading colour matches RGB
#844D42
132
77
66
Font or Shading colour matches RGB
#094353
9
67
83
Font or Shading colour matches RGB
FALL 2023 WEEK 4
3 of 5
Number Systems Activity
Computer Principles for Programmers
#7D6CB7
125
108
183
Font or Shading colour matches RGB
FALL 2023 WEEK 4
4 of 5
Related Documents
Related Questions
I need help solving this problem.
arrow_forward
HW_5_01P.pdf
PDF
File | C:/Users/Esther/Downloads/HW_5_01P.pdf
2 Would you like to set Microsoft Edge as your default browser?
Set as default
To be most productive with Microsoft Edge, finish setting up your
Complete setup
Maybe later
browser.
(D Page view A Read aloud V Draw
7 Highlight
2
of 3
Erase
5. Two cables are tied to the 2.0 kg ball shown below. The ball revolves in a horizontal
circle at constant speed. (Hint: You will need to use some geometry and properties of
triangles and their angles!)
60°
1.0 m
60°
© 2013 Pearson Education, Inc.
(a) For what speed is the tension the same in both cables?
(b) What is the tension?
2.
2:04 PM
O Type here to search
C A
2/9/2021
(8)
arrow_forward
I need help coding in MATLAB. I have a .txt file containing the following data. That data is saved in a file named data.txt. I am wondering how I could extract all or some of that data into another .m file. Can you show me the code.
[[5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975]]
arrow_forward
a.mheducation.com/ext/map/index.html?_con%3Dcon&external_browser%3D08&launchUrl=https%253A%252...
Check my
NOTE: This is a multi-part question. Once an answer is submitted, you will be
unable to return to this part.
The bob of a simple pendulum of length /= 40 in. is released from rest when 0 =
5°.
Assuming simple harmonic motion, determine the magnitudes of the velocity and acceleration of
the bob after the pendulum has been in motion for 1.65 s.
The magnitude of the velocity of the bob after the pendulum has been in motion for 1.65 s is
82699 ft/s.
The magnitude of the acceleration of the bob after the pendulum has been in motion for 1.65 s is
t/s2.
Menu
Tro
Dicection
In
fuel
arrow_forward
You are part of a car accident investigative team, looking into a case where a car drove off a bridge. You are using the lab projectile launcher to simulate the accident and to test your mathematical model (an equation that applies to the situation) before you apply the model to the accident data. We are assuming we can treat the car as a projectile.
arrow_forward
For each of the examples below and in 3a_Frame_Examples.doc Download 3a_Frame_Examples.doc, draw and determine the following using the D-H convention presented in class and explained in the text.
link number
link name
joint number
joint type (R or P)
link coordinate origin location
link x axis direction
link y axis direction
link z axis direction
translation from proximal to distal end
rotation from proximal to distal end
homogeneous transformation matrix
arrow_forward
Part III Capstone Problem
Interactive Physics - [Lab7Part3.IP]
Eile Edit World View Object Define Measure Script Window Help
Run StoplI Reset
圖|& 品凸?
Time
Length of Spring 22
6.00
dx
Center of Mass of Rectangle 2
5.000
Tension of Rope 3
Jain@
IFI
... N
ot
rot
***lad
Split
4.000
Velocity of Center of Mass of Rectangle 2
Vx Vx
V Vy
MM
Ve
- m/s
m/s
3.00
*** m/s
Vo
..* lad/s
2 00
Center of Mass of Rectangle 1
1.000
tol
rot
*.* rad
EVelocity of Center of Mass of Rectangle 1
Vx Vx
VVy
M
0.000
-m/s
w 30
m/s
w..
MI
Ve
母100
*** m/s
Vo
... rad/s
+
EAcceleration of Center of Mass of Rectangle 1
Ax Ax
A Ay
AUJAI
Ae
--- m/s^2
... m/s^2
-- m/s^2
.-- rad/s^2
3.00
Aø
Mass M1 = 2.25 kg is at the end of a rope that is 2.00 m in length. The initial angle with
respect to the vertical is 60.0° and M1 is initially at rest. Mass M1 is released and strikes M2
= 4.50 kg exactly horizontally. The collision is elastic. After collision, mass M2 is moving on
a frictionless surface, but runs into a rough patch 2.00…
arrow_forward
Hello Good Evening Sir,I have a question in my homework related structural statics lesson. The following below is my question. Please advice. Thank you so much
Regards,Yusuf
arrow_forward
I have a machine theory assignment and I am adding the conditions of this assignment here as a picture. You choose the mechanism and write the necessary solutions for this mechanism.
arrow_forward
For the Following question Graph all 4 : [I just need all 4 graphs and please explain and make clean solution]
Position vs time
Velocity vs time
Acceleration vs time
Force vs time
[For your convenience, I have solved the numerical solutions for the problem] (Please Look at the picture since it is much cleaner)
Question : A 550 kilogram mass initially at rest acted upon by a force of F(t) = 50et Newtons. What are the acceleration, speed, and displacement of the mass at t = 4 second ?
a =(50 e^t)/(550 ) [N/kg]
v = ∫_0^t▒(50 e^t )dt/(550 )= v_0 +(50 e^t-50)/550=((e^t- 1))/11
x = ∫_0^t▒(e^t- 1)dt/(11 )= x_0 +(e^t- t - 1)/(11 )
a(4s)=(50*54.6)/550= 4.96[m/s^2 ]
v(4s)=((e^4-1))/11= 4.87[m/s]
x(4s)=((e^4- 4 - 1))/11= 4.51 [m]
arrow_forward
As shown in figure a Pepsi can and a plastic Pepsi bottle. Describe how they were manufactured
arrow_forward
I need help with my MATLAB code. I am trying to plot the semi major axis and eccentricity with the following code with rungge kutta method. I have two different nnn's in the code which produce two different step sizes. So, I am wondering why both give the same exact plots for semi-major axis and eccentricity. The orbital dynamics fucntion considers J2, drag, SRP, and third body effects.
% Orbital elements obtained from TLE
inc = 63.5000118; % Inclination (degs)
raan = 19.999977; % RAAN (degs)
ecc = 0.001; % Eccentricity
argp = 120.02165342; % argument of perigee (degs)
v = 0; % True anomaly (degs)
a = 6584.697271; % Semi-major axis (km)
mu = 3.986e5;
period = (2*pi*sqrt((a^3)/mu));
% Calculating the state vector in eci frame
[x, y, z, vx, vy, vz] = kep2cart(a, ecc, inc, raan, argp, v);
Y = [x, y, z, vx, vy, vz];
options = odeset('RelTol', 1e-12, 'AbsTol', 1e-12);
nnn1 = 800;
t_step1 = period/nnn1;
m6 = 50;
h_step6 = t_step1/m6;
t_total6 = 0:h_step6:10*period;
[t6,…
arrow_forward
Could you please explain where and what is tight side and also how to find 5-9
arrow_forward
Solve the following without the use of AI. Show all steps. Thank You!
arrow_forward
Need help, round answers to 3 sig figs please
arrow_forward
Please answer immediately, i really need it as soon as possible.
Also please include complete solution thank you!
arrow_forward
For the following concentration expressions, indicate whether they are uniform or nonuniform
and in how many dimensions (OD, 1D, 2D, or 3D), and steady or unsteady. Then for the following
control volume and origin, and table of constants, use Excel or Matlab to graph profiles that
show how concentration changes within the control volume and over time to a limit of 20 for
the following: C(x,0,0,0), C(0,y,0,0), c(0,0,z,0) and C(0,0,0,t). On each graph, show which
parameters are held constant, the CV boundaries, and the point where all four plots overlap.
20
C(x=0)
10
a
0.0001
b
0.001
20
0.01
y
k
0.1
100
All of the following functions are C(space, time) and so not necessarily just x as suggested.
a. C,(x)= C,(x = 0)x exp{- ax}
d. C, (x) = C, (x = 0)x exp{-ax}x exp{- by² }x exp{-cz²}x exp{- kt}
arrow_forward
Produce a 3D solid model of the Guard casing and test boss using solid works, send the file so I can download it.
Email: lukecass3456@gmail.com
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY
Related Questions
- I need help solving this problem.arrow_forwardHW_5_01P.pdf PDF File | C:/Users/Esther/Downloads/HW_5_01P.pdf 2 Would you like to set Microsoft Edge as your default browser? Set as default To be most productive with Microsoft Edge, finish setting up your Complete setup Maybe later browser. (D Page view A Read aloud V Draw 7 Highlight 2 of 3 Erase 5. Two cables are tied to the 2.0 kg ball shown below. The ball revolves in a horizontal circle at constant speed. (Hint: You will need to use some geometry and properties of triangles and their angles!) 60° 1.0 m 60° © 2013 Pearson Education, Inc. (a) For what speed is the tension the same in both cables? (b) What is the tension? 2. 2:04 PM O Type here to search C A 2/9/2021 (8)arrow_forwardI need help coding in MATLAB. I have a .txt file containing the following data. That data is saved in a file named data.txt. I am wondering how I could extract all or some of that data into another .m file. Can you show me the code. [[5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975], [5.0018696581196584, 17.863820207570207, -13.086858974358975]]arrow_forward
- a.mheducation.com/ext/map/index.html?_con%3Dcon&external_browser%3D08&launchUrl=https%253A%252... Check my NOTE: This is a multi-part question. Once an answer is submitted, you will be unable to return to this part. The bob of a simple pendulum of length /= 40 in. is released from rest when 0 = 5°. Assuming simple harmonic motion, determine the magnitudes of the velocity and acceleration of the bob after the pendulum has been in motion for 1.65 s. The magnitude of the velocity of the bob after the pendulum has been in motion for 1.65 s is 82699 ft/s. The magnitude of the acceleration of the bob after the pendulum has been in motion for 1.65 s is t/s2. Menu Tro Dicection In fuelarrow_forwardYou are part of a car accident investigative team, looking into a case where a car drove off a bridge. You are using the lab projectile launcher to simulate the accident and to test your mathematical model (an equation that applies to the situation) before you apply the model to the accident data. We are assuming we can treat the car as a projectile.arrow_forwardFor each of the examples below and in 3a_Frame_Examples.doc Download 3a_Frame_Examples.doc, draw and determine the following using the D-H convention presented in class and explained in the text. link number link name joint number joint type (R or P) link coordinate origin location link x axis direction link y axis direction link z axis direction translation from proximal to distal end rotation from proximal to distal end homogeneous transformation matrixarrow_forward
- Part III Capstone Problem Interactive Physics - [Lab7Part3.IP] Eile Edit World View Object Define Measure Script Window Help Run StoplI Reset 圖|& 品凸? Time Length of Spring 22 6.00 dx Center of Mass of Rectangle 2 5.000 Tension of Rope 3 Jain@ IFI ... N ot rot ***lad Split 4.000 Velocity of Center of Mass of Rectangle 2 Vx Vx V Vy MM Ve - m/s m/s 3.00 *** m/s Vo ..* lad/s 2 00 Center of Mass of Rectangle 1 1.000 tol rot *.* rad EVelocity of Center of Mass of Rectangle 1 Vx Vx VVy M 0.000 -m/s w 30 m/s w.. MI Ve 母100 *** m/s Vo ... rad/s + EAcceleration of Center of Mass of Rectangle 1 Ax Ax A Ay AUJAI Ae --- m/s^2 ... m/s^2 -- m/s^2 .-- rad/s^2 3.00 Aø Mass M1 = 2.25 kg is at the end of a rope that is 2.00 m in length. The initial angle with respect to the vertical is 60.0° and M1 is initially at rest. Mass M1 is released and strikes M2 = 4.50 kg exactly horizontally. The collision is elastic. After collision, mass M2 is moving on a frictionless surface, but runs into a rough patch 2.00…arrow_forwardHello Good Evening Sir,I have a question in my homework related structural statics lesson. The following below is my question. Please advice. Thank you so much Regards,Yusufarrow_forwardI have a machine theory assignment and I am adding the conditions of this assignment here as a picture. You choose the mechanism and write the necessary solutions for this mechanism.arrow_forward
- For the Following question Graph all 4 : [I just need all 4 graphs and please explain and make clean solution] Position vs time Velocity vs time Acceleration vs time Force vs time [For your convenience, I have solved the numerical solutions for the problem] (Please Look at the picture since it is much cleaner) Question : A 550 kilogram mass initially at rest acted upon by a force of F(t) = 50et Newtons. What are the acceleration, speed, and displacement of the mass at t = 4 second ? a =(50 e^t)/(550 ) [N/kg] v = ∫_0^t▒(50 e^t )dt/(550 )= v_0 +(50 e^t-50)/550=((e^t- 1))/11 x = ∫_0^t▒(e^t- 1)dt/(11 )= x_0 +(e^t- t - 1)/(11 ) a(4s)=(50*54.6)/550= 4.96[m/s^2 ] v(4s)=((e^4-1))/11= 4.87[m/s] x(4s)=((e^4- 4 - 1))/11= 4.51 [m]arrow_forwardAs shown in figure a Pepsi can and a plastic Pepsi bottle. Describe how they were manufacturedarrow_forwardI need help with my MATLAB code. I am trying to plot the semi major axis and eccentricity with the following code with rungge kutta method. I have two different nnn's in the code which produce two different step sizes. So, I am wondering why both give the same exact plots for semi-major axis and eccentricity. The orbital dynamics fucntion considers J2, drag, SRP, and third body effects. % Orbital elements obtained from TLE inc = 63.5000118; % Inclination (degs) raan = 19.999977; % RAAN (degs) ecc = 0.001; % Eccentricity argp = 120.02165342; % argument of perigee (degs) v = 0; % True anomaly (degs) a = 6584.697271; % Semi-major axis (km) mu = 3.986e5; period = (2*pi*sqrt((a^3)/mu)); % Calculating the state vector in eci frame [x, y, z, vx, vy, vz] = kep2cart(a, ecc, inc, raan, argp, v); Y = [x, y, z, vx, vy, vz]; options = odeset('RelTol', 1e-12, 'AbsTol', 1e-12); nnn1 = 800; t_step1 = period/nnn1; m6 = 50; h_step6 = t_step1/m6; t_total6 = 0:h_step6:10*period; [t6,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Elements Of ElectromagneticsMechanical EngineeringISBN:9780190698614Author:Sadiku, Matthew N. O.Publisher:Oxford University PressMechanics of Materials (10th Edition)Mechanical EngineeringISBN:9780134319650Author:Russell C. HibbelerPublisher:PEARSONThermodynamics: An Engineering ApproachMechanical EngineeringISBN:9781259822674Author:Yunus A. Cengel Dr., Michael A. BolesPublisher:McGraw-Hill Education
- Control Systems EngineeringMechanical EngineeringISBN:9781118170519Author:Norman S. NisePublisher:WILEYMechanics of Materials (MindTap Course List)Mechanical EngineeringISBN:9781337093347Author:Barry J. Goodno, James M. GerePublisher:Cengage LearningEngineering Mechanics: StaticsMechanical EngineeringISBN:9781118807330Author:James L. Meriam, L. G. Kraige, J. N. BoltonPublisher:WILEY
Elements Of Electromagnetics
Mechanical Engineering
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Oxford University Press
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:9780134319650
Author:Russell C. Hibbeler
Publisher:PEARSON
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:9781259822674
Author:Yunus A. Cengel Dr., Michael A. Boles
Publisher:McGraw-Hill Education
Control Systems Engineering
Mechanical Engineering
ISBN:9781118170519
Author:Norman S. Nise
Publisher:WILEY
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:9781337093347
Author:Barry J. Goodno, James M. Gere
Publisher:Cengage Learning
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:9781118807330
Author:James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:WILEY