Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
39 views
12 pages
Physics 2nd Year (Comp. Programming)
Uploaded by
Sachin Jangra
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save physics 2nd year (comp. programming) For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
39 views
12 pages
Physics 2nd Year (Comp. Programming)
Uploaded by
Sachin Jangra
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save physics 2nd year (comp. programming) For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save physics 2nd year (comp. programming) For Later
You are on page 1
/ 12
Search
Fullscreen
our (8 COTE PROGRAMMING & THERMO 7. Select the RUN option (in case of FORTRAN 77) oF BUY (in case of FORTRAN 95) and click the compile option 0 © program and if there is no error (i.e., program is compile’ run option, another window will appear on the desktoP- 8. Enter the values of the input and note the required outP them. (228 APPLICATIONS OF FORTRAN PROGRAMMING PROBLEM 1 () DEFINING THE PROBLEM : To find maximum, minimum and the range of given set of numbers. (i) FLOWCHART: ut and save Read N, first number K1 Max «Ki Min Ki DO101=2,Ni) PROGRAM : " 7a (iB) sub proemt 2 RANGE. {iv) EXECUTION : APPLICATIONS OF FORTRAN PROGRAMMING B file Edit Search View Run Options Tools 10 REAL MAX, MIN, K WRITE(*,*) ‘BiTER THE LENGTH OF SET" READ (*, *)17 WRITE (+, +) ‘ENT! READ (*,%) x MAX=K MIN=K DO 10 I=2,N READ (*,*) TE (®.GT.MAX) Max-x Tk (K. LT.MIN) MINSK cor: "ER THE NUMBERS + IMUM= am WRITE(*,*) *RANGE=" RANGE STOP END PROBLEM 2 @ DEFINING THE PROBLEM : To find out the roots of a quadratic equation.> — COMPUTER PROGRAMMING & THERMODYNAMICS (ii) FLOWCHART : rae (w) PRO[APPLICATIONS OF FORTRAN PROGRAMMING. Fae ene el (iii) PROGRAM: Fore D Ble Est Search } d+ eX x D Ausdatc Een! (iv) EXEC! PROBLEM 3 ‘UTION : Riera Peer Bun Options Tools Window Help 9e) LOGO the values of A,B,C! READ(#,*) /2,B,C De (BB) ~49R+C Ie (E-LT.0) THEN WRITE(+,*} "Roots are imaginary" ELSE, Te(C.20.0) THEN WRITE(*,*) "Roots are real and equal! RL = -8/ (242) R2=R1 WRITE (*, *)R1/R2 ELSE WRITE(*,*) "Roots are real and distinct’ sqrt (0))/ (248) RQ = (-B-sqrt(0})/(2*A) ‘WRITE (*, *)R1,R2 END IB @ DEFINING THE PROBLEM: To find average and standard deviation of given numbers.@ DEFINING THE PROBLEM: To Print all Natural (Even/Oda) @) ALGORITHM; STEP1 ; STEP 2 : STEP3 :; STEP 4 : STEP5 : STEP6 : Numbers between Given Limits BEGIN (READ LOWER AND UPPER LIMIT] READ L, u IF (MOD (L, 2) = 0) THEN EL=L OL=L+1 ELSE EL=L4+1 OL=L END IF [LOOP PROCESS] DOI=EL, U,2 WRITE I CONTINUE - (LOOP PROCESS] DOI=OL, U,2 WRITE I CONTINUE ENDer the curve is found by adding the area r 1 1 1 = Area = 5 Vo gy det Or ty) A+ 5 a + Ya) Ax, We can simplify this to give us the Trapezoidal Rule, for n trapezoids » prea Ax(7B+ns 9849 * oo +2) e have : Ax > 0- For more trapezoids w' e is above the x-axis onl, We can write (if the curv ly between x =a andx=) Area = [; popaenas(Sbtos* ist %) PROBLEM 9 @ DEFINING THE PROBLEM: To find integration of a definite integral by trapezoidal rule. qi) ALGORITHM : STEP 1 : BEGIN (DEFINE THE FUNCTION] F(X) = VK? +1 {READ THE NO. OF SECTIONS READ N, A, B [CALCULATE THE SEGMENT WIDTH] He |B-A|/N STEPS : K1<0;K2<0 STEP6 : [LOOP PROCESS] DO LOOP I=0,N STEP7 : IF('=0ORI=N) THEN K1¢K1+F(A+I*H) ELSE K2< K2+ F(A +1*H) ENDIF CONTINUE STEP 2 : STEP3 : N, BOUNDS A AND BI STEP 4 :STEP8 : [COMPUTE THE VALUE OF AREA] | AREA < | H/2* (K1 + 2*K2)| sTEP9 : [PRINT AREA] WRITE AREA sTEP10: END (ii) FLOWCHART:. 3 @ File Edit Search View Run Q tions Tocls Window Help O@- ARE X iA 9ajp 82o ——— 1 trapezoidal Rule bo find area | ial | 2 REAL K1,K2 (es | a F(x)=sqrt_ (x+4241) | i 4 WRITE (*,*) ‘Enter the number of Section: | 1! 5 READ (*, 3) 17 | \ 6 WRITE(*,*) ‘Enter the bounds! | % READ (*,*)A,B | H 8 BABS (B-A) /y | 2 Kiso | \ 18 K2=0 | . DO 10 ta0,1 12 Ir (1.20.9) .OR. (1.80.0) THEN | 13 KL=KL+F (AHH) | 14 ELSE | is K2=K2+F (ALI) \ 16 END IF i 1? 10 CONTINUE | | 18 BRERWABS ( (8/2) (K1424K2) i 7 WRITE (+, +) apex \ Re a stop | | at ED @) EXECUTION A EB tractive tapizsldl Enter the number of eorrary Enter the hounds 5 1 RLSTAREA = [S(S-A) (S-B) (S-C) Print TAREA’ Input Radius SAREA = 4 x x x (RADIUS)? PRINT SAREA CAREA=2 xR XL PRINT CAREA Cc AND CYCLINDER WRITE(*, *) ****AREA COMPUTATION*#**” PROGRAM TO FIND OUT THE AREA OF A TRIANGLE. SPHEREINTRODUCTION TO. COMPUTER ARCHITECTURE & PROGRAMMING WRITE (*,*)’ [1] AREA OF TRIANGLE’ WRITE (*,")' [2] AREA OF SPHERE * WRITE (*,*)' [3] AREA OF CYLINDER’ WRITE (*,*)’ ENTER YOUR CHOICE (1, 2 OR 3)" READ(*, *) CHOICE IF (CHOICE.EQ.1) THEN WRITE (*,*) ‘ENTER THREE SIDES OF A TRIANGLE” READ (*,*) A,B,C S=(A+B+C)/2 TAREA=SQRT (S*(S-A) * (S-B) * (S-C)) WRITE (*, *) ‘AREA OF TRIANGLE=", TAREA ENDIF IF (CHOICE.EQ.2) THEN WRITE (*, *) “ENTER RADIUS OF SPHERE” READ (*, *) RADIUS SAREA = 4 * 3-1415 * RADIUS * RADIUS WRITE (*, *) ‘AREA OF SPHERE=", SAREA ENDIF IF (CHOICE-EQ:3) THEN WRITE (*, *) ‘ENTER RADIUS AND LENGTH" READ (*,*) RADIUS.LENGTH CAREA=2*3.1415*RADIUS*LENGTH WRITE (#,*) ‘AREA OF CYLINDER=". CAREA ENDIF STOP END C:\FORTRAN>TSCAREA *** AREA COMPUTATION**#** [I] AREA OF TRIANGLE [2] AREA OF SPHERE [3] AREA OF CYLINDER ENTER YOUR CHOICE (1, 2 OR 3) 1 ENTER THREE SIDES OF A TRIANGLE 234 AREA OF TRIANGLE= 29047370 Stop — Program terminated.fi NEW COLLEGE PRACTICAL PHYSICS (VOL. 11) CAFORTRAN@TSCAREA #*t AREA COMPUTATION**** UW AREA OF TRIANGLE (2) AREA OF SPHERE 13) AREA OF CYLINDER ENTER YOUR CHOICE (1. 2 OR 3) 2 ENTER RADIUS OF SPHERE 33 AREA OF SPHERE = 136.8437000 Stop — Program terminated. C\FORTRAN> Experiment No. 7 : Giver variabel x evaluate the function defined by F@)=ad+ bx teifx
d For cach value of x, and print arbitray number of x values. n values for a. 5, ¢ and d and a sct of values for the the valuc of x and f(x) write a program for an
You might also like
ScientificComputing2eHeath Solution
PDF
100% (11)
ScientificComputing2eHeath Solution
161 pages
The Meaning of An Algorithm:: CCP Lab Manual, 10CPL16/26
PDF
100% (3)
The Meaning of An Algorithm:: CCP Lab Manual, 10CPL16/26
78 pages
Fortran Programs For Physics Students
PDF
No ratings yet
Fortran Programs For Physics Students
51 pages
Cs 60
PDF
No ratings yet
Cs 60
80 pages
Fortran Programming
PDF
No ratings yet
Fortran Programming
192 pages
PROGRAM
PDF
No ratings yet
PROGRAM
7 pages
6.illustrative Problems
PDF
No ratings yet
6.illustrative Problems
36 pages
DCIT22 2020 Lecture 1 Algo and Flowchart
PDF
No ratings yet
DCIT22 2020 Lecture 1 Algo and Flowchart
89 pages
Algorithm Observations.
PDF
No ratings yet
Algorithm Observations.
52 pages
Prac-Assignment 1-10
PDF
No ratings yet
Prac-Assignment 1-10
46 pages
Python Lab Experiments With Algm - N - Code
PDF
No ratings yet
Python Lab Experiments With Algm - N - Code
33 pages
CE 206 Programs
PDF
No ratings yet
CE 206 Programs
48 pages
Asgn4 Solution
PDF
No ratings yet
Asgn4 Solution
4 pages
Aryan Practical CS
PDF
No ratings yet
Aryan Practical CS
28 pages
Assignmentm
PDF
No ratings yet
Assignmentm
27 pages
Robin Scilab
PDF
No ratings yet
Robin Scilab
29 pages
PYTHON Lab Manual
PDF
No ratings yet
PYTHON Lab Manual
31 pages
C Pratical..
PDF
No ratings yet
C Pratical..
33 pages
1.fahrenheit To Celsius and Vice Versa Conversion
PDF
No ratings yet
1.fahrenheit To Celsius and Vice Versa Conversion
22 pages
24 Bai 10773
PDF
No ratings yet
24 Bai 10773
16 pages
Python 2
PDF
No ratings yet
Python 2
15 pages
Python Programming
PDF
No ratings yet
Python Programming
20 pages
Python Assignment
PDF
No ratings yet
Python Assignment
7 pages
Algorithmic Problem Solving Examples
PDF
No ratings yet
Algorithmic Problem Solving Examples
15 pages
Rufu.,::R: Auol, LT Reaf, WRLTG - ..... R... O........... ,..... RR - Rr.R... O.E - 3
PDF
No ratings yet
Rufu.,::R: Auol, LT Reaf, WRLTG - ..... R... O........... ,..... RR - Rr.R... O.E - 3
12 pages
Lec 5 - Sequential Structures
PDF
No ratings yet
Lec 5 - Sequential Structures
9 pages
Fortran 77 Basics
PDF
No ratings yet
Fortran 77 Basics
11 pages
Introduction To Python Solutions
PDF
No ratings yet
Introduction To Python Solutions
36 pages
Formatted Document
PDF
No ratings yet
Formatted Document
13 pages
Fortran 90 (Final)
PDF
No ratings yet
Fortran 90 (Final)
14 pages
Matlab Report
PDF
No ratings yet
Matlab Report
8 pages
Topic: Problems Based On General Mathematical Calculations:: S A B C Area Ss As Bs C 2
PDF
No ratings yet
Topic: Problems Based On General Mathematical Calculations:: S A B C Area Ss As Bs C 2
3 pages
Vishwas: CSE101 Harsimran Singh A19
PDF
No ratings yet
Vishwas: CSE101 Harsimran Singh A19
9 pages
Pseudocode Activity
PDF
No ratings yet
Pseudocode Activity
4 pages
Start: Area L W
PDF
No ratings yet
Start: Area L W
6 pages
Scintific Calculator
PDF
43% (7)
Scintific Calculator
29 pages
Create A Flowchart, Pseudo Code, and Source Code That Will Solve The Following Machine Problems
PDF
No ratings yet
Create A Flowchart, Pseudo Code, and Source Code That Will Solve The Following Machine Problems
4 pages
Untitled35: Math M
PDF
No ratings yet
Untitled35: Math M
6 pages
To Find The Area of Rectangle
PDF
No ratings yet
To Find The Area of Rectangle
4 pages
EMS412 Python Practice Test Solutions
PDF
No ratings yet
EMS412 Python Practice Test Solutions
6 pages
Python Lab Manual 2018 by K.Kesavapandian
PDF
No ratings yet
Python Lab Manual 2018 by K.Kesavapandian
30 pages
Problem1 Assessment
PDF
No ratings yet
Problem1 Assessment
2 pages
FlowChart Example 1
PDF
No ratings yet
FlowChart Example 1
3 pages
1 Program
PDF
No ratings yet
1 Program
3 pages
Experiment 4
PDF
No ratings yet
Experiment 4
3 pages
Coding 101
PDF
No ratings yet
Coding 101
2 pages
Assignment Python
PDF
No ratings yet
Assignment Python
2 pages
ASSIGNMENTS
PDF
No ratings yet
ASSIGNMENTS
3 pages
CSCE106 Lab Session 3
PDF
No ratings yet
CSCE106 Lab Session 3
1 page
Ip Practical
PDF
No ratings yet
Ip Practical
4 pages
MP2 Notes
PDF
No ratings yet
MP2 Notes
5 pages
Fortran 95 Practical Exercises
PDF
No ratings yet
Fortran 95 Practical Exercises
10 pages
ME IP Lab1
PDF
No ratings yet
ME IP Lab1
3 pages
Fortran Code For Ioe Studient
PDF
No ratings yet
Fortran Code For Ioe Studient
34 pages