Assignment No. 02 |
Total Marks: 20
Due Date: 28/05/2014 |
|
Instructions: Please read the following instructions carefully before submitting assignment:
Objectives:
To understand and familiarize with ADA Language.
|
||
For any query about the assignment, contact at cs508@vu.edu.pk or through MDB. |
||
Assignment Questions |
||
Question Marks 10
To find the area of a sphere we use following formula Write a complete program in Ada to solve this formula. Note that each mathematical operator (such as multiplication and division) should be solved in a separate subprogram.
In the main program you will use 7 as the value of r. Your program will display the final result and your VU student id.
Hint : You need to solve equation (4 / 3 ) *( 3.14 * r * r *r)
Question Marks 10
You will go to page http://www.compileonline.com/compile_ada_online.php
Paste you code written in the Question 1 in right hand pan and press Compile & Execute button, then you will take screen shot of the output and paste in your solution file. As shown below
|
||
BEST OF LUCK
|
Tags:
Assalam-O-Allaekum
Dear All Fellows....
Please share your comments, suggestion and discussion regarding Assignment No-2 Graded, Final date is 26/5/2014.... Hurry up and one step forward to solve this assignment ......
Best Wishes
We have to create 2 functions that will return the multiplication and division of given variables (2 (we can use 1 variable 3 times) variable for multiplication and 2 for division).
Then we call the functions in the main procedure give them values to calculate, save them in two variables then we multiply those two variable with each other to get the volume of the sphere.
All information can be learned through simple Google search.
Please Discuss here about this assignment.Thanks
Our main purpose here discussion not just Solution
We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.
Basic Concepts of ada programming languge is
hello friends code is here
with Ada.Text_IO;
use Ada.Text_IO;
with Ada.Float_Text_IO;
use Ada.Float_Text_IO;
procedure Exercise is
r : integer := 7;
result1 : integer;
result2 : float;
number1 : float :=3.0;
number2 : float :=4.0;
begin
result1 := r*r*r;
result2 := (number2/number1)*3.14;
Put_Line("Number: " & natural'image(result2));
end Exercise;
Thank you bahi.
But sorry to say it is not compiling. The error is shown below.
gcc -c exercise.adb
exercise.adb:15:41: expected type "Standard.Integer"
exercise.adb:15:41: found type "Standard.Float"
gnatmake: "exercise.adb" compilation error
change Put_Line("Number: " & natural'image(result2));
into Put_Line("Number: " & float'image(result2));
frndz is this number correct
Number: 4.18667E+00
as a result?
doll koi hint e day do yar...
© 2021 Created by + M.Tariq Malik.
Powered by
Promote Us | Report an Issue | Privacy Policy | Terms of Service
We are user-generated contents site. All product, videos, pictures & others contents on site don't seem to be beneath our Copyrights & belong to their respected owners & freely available on public domains. We believe in Our Policy & do according to them. If Any content is offensive in your Copyrights then please email at m.tariqmalik@gmail.com with copyright detail & We will happy to remove it immediately.
Management: Admins ::: Moderators
Awards Badges List | Moderators Group
All Members | Featured Members | Top Reputation Members | Angels Members | Intellectual Members | Criteria for Selection
Become a Team Member | Safety Guidelines for New | Site FAQ & Rules | Safety Matters | Online Safety | Rules For Blog Post