Modify a single program using control structures

Assignment Help Computer Engineering
Reference no: EM1332155

A problem is needed using microsoft visual C++
to do the following.

Problem Description:
For your strength of materials course you will write a single program using control structures(including nested loops)and file I/O to explore the deflection of a cantilever beam with a point load at the free end. This is to be on the base on the equation for the eleastic curve of the form:

y=P/(EI)*(x(cubed)-3Lx(squared))
xcubed is x to the 3rd power and x sqaure is x to the 2nd power

Where y is the vertical deflection from the neutral axis-counterline-(inches,negative downward),P is the point load in pounds (lbs.,positive downward), x is the distance from the mounting point of the beam(inches), and L is the lenght of the beam (inches). Other properties of the beam that reflect its resistance to bending are E, the Modulus of Elasticity(psi or ibs/in sq), increasing for stronger materials) and I , the Moment of Inertia(inches to the 4th power, increasing for sturdier beam cross-sectional shapes). we will assume that the length is short enough that the weight of the beam itself may be safely ignored.

The program should offer the user the opportunity to perform one of two tasks then repeat or exit. The simplest approach with respect to analysis, design and testing is to treat each task as a separate small problem- with a simple wrapper around them to support user selection:

1. Read in a user supplied date file containing results from a lab experiment which measured actual deflection in a beam. The text file is of the form with E,I,L(in feet!!), and load P on each of the first four lines. This header is followed by the x,y data pairs (both in inches, number not known in advance!), one set per line with evenly spaced columns.
For each data point, output the current values, the theoretical value of y calculated from the formula for the elastic curve and the error between the two y values as a percentage of the theoretical value- on the same line. NOTE:At the end of the report display all info for the data point with the greatest discrepancy(plus or minus)<-this is the error, NOT the deflection. Send this output to the screen AND a user-specified file with a report header with your name and project info, listingand explaning the values from the top of the data file and the tabular data in cleanly formatted columes with headers, and consistent spacing and precision. Show enough decimal places.
THE DATA FILE PROGDATA.TXT IS SHOWN BELOW

2.Construct a table of deflections under various loads for a user-specified beam with E,I and L. This report will have x position information (user-specifies number of steps going down the page and the deflections calculatedat that same location for varing loads across the page in the same row. YOU MUST USE NESTED LOOPS.

let the user give a starting and ending loads for the interval to explore and offer him the choice of incrementing the load by 1,2,5,10 lbs(he will choose one) Print a header with all data (yours and the beam's), then nicely formatted columns with headers ( the load for that column-hint: use a loop here too), Again, print output to both the screen and a user specified file.

For testing purposes use values for the beam of:
Modulus of Elasticity E=29*10(to the 6th power)psi
Moment of Inertia I=82.8 Inches to the 4th power
Length L=12 ft( remember conversion to inches!)
# Steps foe x:15
Loads:from 280 to 320 lbs in steps of 10 lbs.

All input prompts and outputs should indicate the approprate units-BUT units should NOt be repeated in tabular output and should instead specified up in the report header.
Also, exit() the program if the values are entered from the user (or file) that would cause division by zero.
After solving a problem the program should display the main menu again and keep running until the user chooses to exit.

PROGDATA.TXT

29000000.0
82.8
12.0
300.0
0.000000 0.000000
9.600000 -0.000822
19.200000 -0.003119
28.800000 -0.007126
38.400000 -0.012091
48.000000 -0.018069
57.600000 -0.025788
67.200000 -0.035042
76.800000 -0.044516
86.400000 -0.054040
96.000000 -0.063109
105.600000 -0.077264
115.200000 -0.087870
124.800000 -0.100241
134.400000 -0.110278
144.000000 -0.125321

this date file is pulled from notepad.

Reference no: EM1332155

Questions Cloud

Identify 3 relevant and nonrelevant cost : Assist in Identifying three relevant and three non-relevant costs and set up a table to present the information and then discuss the information. Include the following and f you cannot identify specific actual amounts, make a reasonable estimate and ..
Build a code in preparation for creating a spell-checker : Write down a code in preparation for creating a spell-checker. For now don't worry about actually spell checking: Just write a program that can read in the dictionary word by word.
How to calculate federal and fica taxes withheld : how to calculate federal and fica taxes withheld.
Find productivity improvement by reducing materials cost : CD players are produced on an automated assembly line process. The standard cost of CD players is $150 per unit [labor $30, materials $70 and overhead $50] the sales price is USD 300 per unit.
Modify a single program using control structures : For your strength of materials course you will write down a single program using control structures(including nested loops)and file I/O to explore the deflection of the cantilever beam with a point load at the free end.
The airline industry using excel solver : During the month of July, Pittsburgh resident Bill Fly must make 4 round-trip flights between Pittsburgh and Chicago. These are the dates of the meetings Bill must attend:
How many units of the contract will the agent buy : Suppose a risk averse agent. Explain how many units of the contract will the agent buy if the price is q=k.
Organizational structure employed by the organization : Analyze the reason for the type of organizational structure employed by the organization
Simple textual table defining catalogues of retail store : make a function to read a series of catalogue records from a file into a vector of catalogue objects. You will need to use the class ifstream that is derived from istream, like so.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Relationship of tactical-strategic and operational plans

Explain what is meant by the relationship of tactical, strategic, and operational plans, and their individual planning horizons as applied to the telecommunications field.

  Reasons to incorporate the venturing

Explain how are corporate ventures differentiated from other projects within the large organizations and from the entrepreneurial start-ups? List some of the reasons which incorporate the venturing has had a relatively poor track record?

  Compute the entropy and clarity of each cluster

Compute the entropy and clarity of each cluster

  Recognizing the error

Make out error in the following given code:#include //Line 1 using namespace std; //Line 2

  What technologies are used in windows server 2008

What technologies are used in windows server 2008

  Define the use of contractions, slang and icons

Does the use of contractions, slang and icons in text messaging and email signal the development of a new communication style, or just the death of appreciation of written language.

  Time and space complexity

Express the following five loosely explained problems carefully in the form as used in the "Computers and Intractability".

  Program declaring an integer variable

Write down a complete program that declares an integer variable, reads a value from keyboard into that variable.

  Program that continuously outputs random numbers

Write down a code in Java that continuously outputs random numbers between 0 and 10000 until a number which is divisible by 5 is encountered.

  Differentiated services and set of contiguous routers

Explain in scholarly detail why the differentiated services (DS) domain consists of the set of contiguous routers?

  Determining the better internet browser

Which among the following is better software tool: Mozilla Firefox, Internet Explorer, or Google Chrome? Supplement your argument with evidence, and signify whether or not you alter your position based on the discussion.

  System analysis and design

In the System Analysis and Design: Mixing Techniques – The question “Whether the structured techniques and object-oriented techniques can be mixed.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd