Download Jordan University of Science and Technology

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Big O notation wikipedia , lookup

Location arithmetic wikipedia , lookup

Principia Mathematica wikipedia , lookup

Function (mathematics) wikipedia , lookup

History of the function concept wikipedia , lookup

Function of several real variables wikipedia , lookup

Factorial wikipedia , lookup

Elementary mathematics wikipedia , lookup

Transcript
Jordan University of Science and Technology
CS102 Introduction to programming lab
Summer Semester 2010-2011
Lab#9: Function II
Assignment #1 (20 minutes)
Write a program that declares two double variables and input their values by using a void function
READ that takes two reference parameters.
Send them to the function MULTIPLY that takes two double parameters and return a double of their
product(‫)حاصل ضرب العددين‬.
Send the value of their product to the void function PRINT to print heir values.
The Output is as the following:
Please insert two numbers : 4.5 2
Their product is 9
Assignment #2 (40 minutes)
Write a program that prompts the user to insert a number then calculate the value of this equation
n
Σ 7x3+2x
x=0
by using the following two functions
1- Equation1 : that takes one parameter and return a value
2- Equation2: that takes two parameters and returns nothing
EX. Please insert a number: 2
The sum is 69
The sum is 69
Assignment #3 (20 minutes)
Write a program that prompts the user to insert a positive integer number then send it to a void function
Draw that will print a square of “@” symbols with a diagonal)‫ (قطر المربع‬of “* “ symbols.
EX. Please insert an integer number: 5
$ @@@@
@$ @@@
@@$ @@
@@@$ @
@@@@$