hey all, as part of my computing module i have been asked to create a program that will promp the user for the following:
depth_beam /* i.e fprintf etc "enter value of beam" then fscanf %lf depth_beam*/
breadth_beam
min_moment
max_moment
number_increments /*between minimum and maximum moments*/
then calculate bending stress using a loop controlled by relevant input data ^ and should store values of moment maximum and minimum stress in a linked list.
after completing calculations it is to write the values from the linked list to the screen as a table:
depth of beam:
breadth of beam:
minimum applied moment:
maximum applied moment
number of increments.
as a guide iv included the program that i used on the previous question which was to calculate max and min tensile stresses: #include <stdio.h>
int main(void)
{
double tensile_min;
double tensile_max;
double bending_moment;
double moment_area;
double depth_beam;
double breadth_beam;
fprintf(stdout, "Enter the magnitude of the Applied Bending Moment (Nm):");
fscanf(stdin, "%lf", &bending_moment);
fprintf(stdout, "Enter the Breadth of the beam (m):");
fscanf(stdin, "%lf", &breadth_beam);
fprintf(stdout, "Enter the Depth of the beam (m):");
fscanf(stdin, "%lf", &depth_beam);
moment_area = (breadth_beam * depth_beam * depth_beam * depth_beam) / 12;
tensile_min = ((0-bending_moment) * depth_beam) / (moment_area*2);
tensile_max = (bending_moment * depth_beam) / (moment_area * 2);
fprintf(stdout,"\n\nThe Second Moment of Area for this particular beam is: %.2lf m4\n", moment_area);
fprintf(stdout,"With a Minimun Tensile Stress of %.3lf N/m2\n", tensile_min);
fprintf(stdout,"And a Maximum Tensile Stress of %.3lf N/m2\n", tensile_max);
return(0);
}
cheers in advance, any help would be greatly apreciated, i have got a really unhelpful tutor who wont explain beyond his set of notes (which are extremely poor and unthought-out
James
5 1576
implement the program in sections, e.g. start by -
Read minimum moment
-
Read maximum moment
-
read number of incremenets
-
moment=minimum moment
-
increment =
-
while (moment < = maximum moment)
-
use existing code to calculate the min and max stress
-
moment = moment + increment
-
when that is working put the results in a linked list - do you have to write you own or can you use the STL, e.g.
http://www.cppreference.com/cpplist/index.html
You can write your own. Im not sure i understand your porgram, what exactly do u mean in sections. i really dont understand this. I have tried doing it step by step, but to no avail...
Hi, cheers taking time to help me out.
i need to make a linked list that stores all the values of stress, calculated for each value of applied moment, incorporating the number of increments...
so lets say minimum stress works out to be 100 Nm and max is 500 Nm and your number of increments is 5 then you'd need to store values for 100, 200, 300, 400, and 500 Nm
so, im going to have to define number_increments, as well as the others on my first program, any suggestions
I want the basics on how to start my own c programme
hey guys, really apreciate the help been brought forward and all but im still finding it difficult to take on board the advice given, would it be possible to make an example program of how you would tackle the question so i can see whats been done and how it works or if not just code the loop and the linked list and then word the basics, cheers in advance
Sign in to post your reply or Sign up for a free account.
Similar topics
by: ahevans |
last post by:
HI,
I have the following scenario
if (isset($area)) {
if ($area === 'green') {
if (isset($task)) {
|
by: DD |
last post by:
Hello,
Could anyone please help me??
Is there somebody who could explain me how to make a connection to a access
database with a python cgi script.
I would like to use common sql commands in my...
|
by: Tank |
last post by:
I have had this post up here when i was trying to figure out how to
make leading zeros and have been able to fudge that to work. I am now
have trouble getting the loop that makes the folders to...
|
by: John Flynn |
last post by:
hi all
i'm going to be quick i have an assignment due which i have no idea how to
do. i work full time so i dont have the time to learn it and its due date
has crept up on me ..
As follows:...
|
by: _R |
last post by:
Given that VS2005 has made an effort to clean up the syntax of VC++
(in C++/CLI), is there any future plans to do away with function
protos, ala C#/VB? What are they needed for these days?
|
by: Aaron Smith |
last post by:
I post a message about this, but noone responded.. Well, I've played
around as much as I can and I'm completely stuck and out of ideas.
This should be a really simple task, but it seems that it...
|
by: ward |
last post by:
Greetings.
Ok, I admit it, I bit off a bit more than I can chew.
I need to complete this "Generate Report" page for my employer and I'm
a little over my head. I could use some additional...
|
by: Herb |
last post by:
I am new to vb.net coming from vb6
I built and published an app that work fine on the production machine.
I try installing it on a clean machine and I installed
NETFramework2.0.50727 ( i am...
|
by: netchicken |
last post by:
Hi there,
I am flumoxed with this error that has been plaguing me.
I have loaded up script.aculo.us and prototype, and tried to tet them to run, just simple stuff, to slide down and fade...
|
by: yjh0914 |
last post by:
hi guys! so im basically editting my post i made earlier as it wznt as specific..
i have to make a program that basically ranks students by their cumulative gpa. the student's info is on a csv file...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
| |