Write a single program using control structures

Assignment Help C/C++ Programming
Reference no: EM13938695

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

Problem Description:

For your strength of materials course you wilii 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: EM13938695

Questions Cloud

Prepare a performance report for thorpes conversion costs : Prepare a performance report for Thorpe's conversion costs for last year. Should any cost item be given special attention? Explain. Determine the cost formula for each of Thorpe's conversion costs.
Data on output for a firm in the short run : The table below gives data on output for a firm in the short run. The firm is able to hire labor and its TPP is given. Compute the MPP and MRP for labor if the price of the good is fixed at $12 per unit.  The firm must pay workers $40 a day.  How man..
Calculate the break-even in number of cookies per day : You will analyze and classify the costs of your cookie company and evaluate contribution margin - calculate the break-even in number of cookies per day. What is the break-even in sales dollars each day? How many cookies must you sell in o..
Page report that discusses the liquidity : Write a 1-page report that discusses the liquidity of S & J Plumbing Incorporate. Include the references.
Write a single program using control structures : For your strength of materials course you wilii 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 ..
Describe accompanying important viscoelastic characteristics : Describe with accompanying (sketches) important viscoelastic related characteristics of tendons and ligaments when mechanically stretched. Also describe the mechanical stimuli associated with musculoskeletal tissue differentiation.
Find the most recent economic growth rate : Find the most recent economic growth rate  (or real GDP ) figure for the U.S. economy at the www.bea.gov website. What do you think is the primary reason for this current level of economic growth or contraction?  Explain your answer.
Problem regarding the arrival of aborigines : Mining in Australia probably started with the arrival of Aborigines some 40,000 years ago when they fossicked for stones suitable for tools and weapons, and dug for ochre which they used for decorative use.
Identify and explore contemporary challenges : Identify and explore contemporary challenges and opportunities in information systems and to formulate an opinion or judgement and offer possible solutions.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a switch statement that assigns a string variable

Write a switch statement that assigns a String variable monthName with the months January, February, March, April, May, and June, ifmonthNum is 1, 2, 3, 4, 5, 6, accordingly.

  Assume we have an array named $students

Assume we have an array named $students. Each entry in the array contains a student's full name (e.g. "Jane Smith"). Write the PHP code needed to display all students (in the array) whose first name starts with the letter "J".

  Describes the application of the s4 symmetry operation

(a) Using its x, y, and z coordinates, construct a 15 × 15 matrix that describes the application of the S4 symmetry operation to [PtCl4]^2-.(b) What is the character of this matrix?

  Evaluate the roots of the 2nd order equation

Write a 'C' program to evaluate the roots of the 2nd order equation - Ensure that your program includes the solutions for the subsequent SPECIAL cases

  Write a function named short_path

Write a function named 'short_path' which has two input parameters {M, N} and one output parameter T.

  Prepare a program for a retail-mart company

Prepare a program for a company Retail-Mart.

  Calculate the celsius equivalent of a fahrenheit temperature

Prepare a program to calculate the Celsius equivalent of a Fahrenheit temperature

  Prepare a function comp

We will use 'ft' 'mi' and 'm'.The function should return -1 if D1 in u1 is a smaller distance than D2 in U2; it should return 0 if they are equal distances. Should also return 1 otherwise.

  Generic binary tree using java generics

In this project you will create a generic binary tree using Java Generics.

  User that will be asked to input the time

Write a code for the following C++ problem. We will have a user that will be asked to input the time of a train traveling in terms of minutes and this minutes is a non-negative integer.

  Implementing a client

The CSE3300 server for this exercise waits to receive messages on UDP port 3300 of tao.ite.uconn.edu (IP address 137.99.11.9).1 It iteratively receives a request datagram containing a 32-bit integer representing a social security number

  Discuss the advantages and disadvantages of both the

discuss the advantages and disadvantages of both the structured and object-oriented oo paradigm in programming. why do

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