SlideShare a Scribd company logo
Group 3
Adewumi ezekiel
Computer science
F a j u k o M i c h a e l
A d e w u m i E z e k i e l
E t u k u d o A n d y
A f i a K e n n e d y
ORDER OF PRESENTATION
ETUKUDO ANDY-will introduce the project and talk
on the order in which the project will be presented and
also give a brief knowledge about his contribution in
the group for five (5) minutes.
ADEWUMI EZEKIEL- will present the project titled
“NUMERICAL DATA” and also give a brief knowledge
about his contribution in the group for seven (7)
minutes.
FAJUKO MICHEAL-will run the program that
concerns the project and also give a brief knowledge
about his contribution to the group for seven (7)
minutes.
Finally, AFIA KENNEDY-will talk on the conclusion
and how the project relates to our previous lectures
and also give a brief knowledge about his contribution
to the group for five (5) minutes.
b y
Etukud o A nd y
Arithmetic expression is a valid arrangement of variables,
constants , operators ,operands and parentheses.
e.g
This an expression=x²-(4bc)
where x=variables
B and c=constants
-sign =operators
()sign=parenthesis
4=operands
There are five (5) operations in arithmetic expression that can
be written in java the arithmetic operators are:
Addition(+)
Subtraction(-)
Multiplication(*)
Division(/)
Modulo division (%)
The Evaluation of the Arithmetic Expression
in java is shown below;
•10+25=35
•50-15=35
•6*3=18
•25/5=5
•9%2=1
Precedence Rule
When two or more operators are present in an
expression, we determine the order of
evaluation by following the precedence rules.
Order of Precedence
Bracket( )
Unary operators such as minors sign (-) and plus sign
(+)
Multiplication operator such as multiplication (*),
Division (/) and modulo division (%)
Additive operator such as minors(-) and addition(+)
I call it BUMA
Example 1
6 + ((37 % 8) / 5) =
6 + ( 5 / 5) = 7
Evaluate
(7 * (10 - 5) % 3) * 4 + 9
(7 * 5 % 3) * 4 + 9
(35 % 3) * 4 + 9
2 * 4 + 9
8 + 9
17
1. Write the source code in a .java file
2. Compile the source code into byte code creating a .class file
3. JVM interprets the byte code into machine language as 1s and 0s
and the computer then executes the instructions
By Adewumi
Ezekiel
The Math class is a type of standard class in
the java.lang package. The Math class contains
methods that perform various mathematical
functions.
Example: Square Root
a = Math.sqrt(9.0)
a would receive the value of 3.
Example: Exponents
a = Math.pow(4.0, 2.0)
a would receive the value of 16.
where Math is the class, pow is the method
and the rest are the parameters.
Mathematical Syntax Operation Java Description
Math.sqrt(x) square root of x
Math.pow(x, y) x raised to the exponent y
Math.abs(x) absolute value of x
Some Math Class Methods
16
( ( ( Math.pow( ( ( 1 + Math.sqrt( 5 ) ) / 2 ),fibonacciNum ) ) - ( Math.pow( ( ( 1-
Math.sqrt( 5 ) ) / 2 ), fibonacciNum ) ) ) / Math.sqrt( 5 ) );
Write a formula with the use of mathclass
method that accepts N and displays FN.
The DecimalFormat class (which is part of the
java.text package) is one way to format
numbers.
To format a number using the DecimalFormat class,
a number of steps are required. In the following
example, we will format a number to two decimal
places.
1. Import the java.text.DecimalFormat class.
import java.text.DecimalFormat;
2. Now you must create a DecimalFormat object to format the text
according to a pattern that you specify.
// Declare and initialize DecimalFormat object
DecimalFormat df = new DecimalFormat(“.00”);
df is the name given to the DecimalFormat object we have created
# is a placeholder object that will be removed if there is not a
digit at that location
0 is a placeholder that will show up as zero if a digit is not found at
that location
3. Now we can use the DecimalFormat object to format your
number.
System.out.println(df.format(234.5678));
The above expression outputs 234.57.
The format pattern #.00 asks that a number be converted into
four characters – i.e. one digit to the left of the decimal separator,
a decimal separator, and two digits on the right.
21
DecimalFormat decFor = new DecimalFormat(String pattern);
If I wanted to format the number to zero decimal places,
my DecimalFormat object would be created as
follows:
DecimalFormat df = new DecimalFormat(“#”);
System.out.println(df.format(234.5678));
The above program would output the number 234.5678
would be outputted as 235.
class
parameterVariable name
EXAMPLE
import java.text.DecimalFormat;
class Deci {
public static void main(String args[]) {
//formatting numbers up to 2 decimal places in Java
DecimalFormat df = new
DecimalFormat("######.00");
System.out.println(df.format(364565.14));
//formatting numbers up to 3 decimal places in Java
df = new DecimalFormat("######.000");
System.out.println(df.format(364565.14));
}
}
It will display something like this;
•The input returned from the input dialog box is a
string. If you enter a numeric value such as 123, it
returns “123”. To obtain the input as a number,
you have to convert a string into a number.
•To convert a string into an int value, you can use
the static parseInt method in the Integer class as
follows:
int intValue = Integer.parseInt(intString);
•where intString is a numeric string such as “123”.
To convert a string into a double value, you can use
the static parseDouble method in the Double class
as follows:
double doubleValue
=Double.parseDouble(doubleString);
where doubleString is a numeric string such as
“123.45”.
It is an open code and ready to supply input
data. Typically it corresponds to keyboard input
or another input source specified by the user.
System.in means by inputting the attributes and
method or data.
NOTE -The data collected by the system.in
object is character data, even if they are
entered as numeric digits. Therefore if the
application performs any calculation, the input
character, it must first be converted to
primitive data type before it is used.
It is an open and ready to accept output
data. Typically it corresponds to display
output or another output destination
specified by the user. Writing character
to the system.out using method print()
or print() displays these character on
your screen.
32
GregorianCalendar class is a type of standard class
used for manipulating calendar information such as
year, month, day, hour, minute and second from a
Date object..
 Firstly, identifying the package in which a class
belongs is very important
Therefore
 (Java.util.Gregorian-Calendar is a concrete
subclass of Calendar);
33
However they are constant defined in the calendar class for
retrieving different fragment of calendar/time which are;
Parameters and Constant defined
year - the value used to set the YEAR time field
in the calendar.
month - the value used to set the MONTH time
field in the calendar. Month value is 0-based. e.g.,
0 for January.
WEEK-the constant value for the days of week.
date - the value used to set the DATE time field
in the calendar.
hour - the value used to set the HOUR_OF_DAY
time field in the calendar.
 How to Constructs a GregorianCalendar
with given date and time set for the
default time
GregorianCalendar today = new
GregorianCalendar( );
public GregorianCalendar
(int year,
int month,
int date,
int hour,
int minute,
int second)
And it is possible to create a new GregorianCalendar
object that represents today as
Or specifically presenting the day as January7,
2014, by passing year, month, and day as the
parameters
e.g.
 GregorianCalendar independenceDay = new
GregorianCalendar (2014, 3, 7);
 The value of 3 in the second parameter means
April because the value of the January is 0; and
the value of February which is the second month
of the year is 1 so therefore; the, value of April
is 3
38
Java Data Types
object
array interface class
primitive
integral boolean
byte char short int long
floating point
float double
 When a new Data values is created, Java
allocates space from a pool of memory
called the stack to the variables
Java Primitive Data Types
 Primitive data value is also known as
(numerical data value) used to compute the
sum and the difference of variables (x and
y) in a Java program
 we must first declare what kind of data will
be assigned to them after assigning values
to them, then computing their sum and
difference is made possible, to declare
that the type of data assigned to them is
an integer, we write
 int x, y;
After declaration is made, memory is
allocated to store data values for x and y.
 These memory locations are called
variables, and x and y are the names we
associate with the memory locations.
When declaration is made, we can
assign only integers to x and y but not
real numbers.
 However there are six numerical data
types in Java: byte, short, int, long,
float, and double.
 The difference among these six
numerical data types are their range of
values they can represent
 Also a data type with a larger range of
values is said to have a higher precision
data type.
 Double has a higher precision than the
data type float.
 Memory size for data types
Every data type has some memory size defined. This
enables that whenever a variable is declared, the memory
size is automatically defined
 Default value:
Every primitive data type has default values defined. When
the programmer does not declare to assign any values to the
variables, these default values will be assigned by the
Virtual machine during the object instantiation.
 Range of values the data types can represent
It is extremely important to understand what are the min
and max range of values a data type can be able to hold.
This is syntax for declaring primitive data value
<data type> <variables>;
num1 38
num2 96
Before:
num2 = num1;
num1 38
num2 38
After:
Int number1,number2;
number1 = 138;
number2 = number1
When number2 is declared
as a variable it overwrite the
reference in number1
Object Data type
These are also variables (they can be change) but the
only difference is the content because a variable in an
object contains an address where the object is stored.
Without executing a new command, no new object is
created, two variables can refer to the same object as
the object having two distinct names
 Before a memory is allocated to an object in a program,
it must be declared and initialized
An object declaration simply declares the name
(identifier) that is used to refer to an object.
Where <object names> is a sequence of object names
separated by commas and <Class name> is the name of a
class to which these objects belongs. The name of an
object and the class to which the object belongs
This is the syntax for object declaration:
<Class name> <object names>;
 When an address of an object is
executed and memory space is
allocated
 When the class of an object is
executed there’s a space memory
allocated to it
For object
name2 = name1;
name1
name2
Before:
"Steve Jobs"
"Steve Wozniak"
name1
name2
After:
"Steve Jobs"
From the open book test, we have been drilled to read
and understand the concept of java in chapter two of
McGraw introduction to java. From the first topic, we
learnt about the six programming phases which are;
understand the program, Plan the logic, Code the
program, Test the program etc and this was used while
practicing and working out the java program for each
of the bullet point in question. Class is also the
template in object-oriented programming and it can
also be related to pseudocode.
Numerical data.
Numerical data.

More Related Content

What's hot

Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
k v
 
Datatypes in c
Datatypes in cDatatypes in c
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
Manisha Keim
 
Data types
Data typesData types
Data types
Syed Umair
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
Saad Sheikh
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
Information Technology Center
 
Computer data type and Terminologies
Computer data type and Terminologies Computer data type and Terminologies
Computer data type and Terminologies
glyvive
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
Neeru Mittal
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
MOHIT TOMAR
 
Data types
Data typesData types
Data types
Nokesh Prabhakar
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
 
Data types in C
Data types in CData types in C
Data types in C
Satveer Mann
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
 
Typedef
TypedefTypedef
Typedef
vaseemkhn
 
Numeric Data Types & Strings
Numeric Data Types & StringsNumeric Data Types & Strings
Numeric Data Types & Strings
Abhinav Porwal
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
tanmaymodi4
 
Data types
Data typesData types
Data types
Zahid Hussain
 
cs8251 unit 1 ppt
cs8251 unit 1 pptcs8251 unit 1 ppt
cs8251 unit 1 ppt
praveenaprakasam
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
 

What's hot (19)

Concept Of C++ Data Types
Concept Of C++ Data TypesConcept Of C++ Data Types
Concept Of C++ Data Types
 
Datatypes in c
Datatypes in cDatatypes in c
Datatypes in c
 
Concept of c data types
Concept of c data typesConcept of c data types
Concept of c data types
 
Data types
Data typesData types
Data types
 
C data types, arrays and structs
C data types, arrays and structsC data types, arrays and structs
C data types, arrays and structs
 
Lect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer AbbasLect 9(pointers) Zaheer Abbas
Lect 9(pointers) Zaheer Abbas
 
Computer data type and Terminologies
Computer data type and Terminologies Computer data type and Terminologies
Computer data type and Terminologies
 
Variables in C++, data types in c++
Variables in C++, data types in c++Variables in C++, data types in c++
Variables in C++, data types in c++
 
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
 
Data types
Data typesData types
Data types
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Data types in C
Data types in CData types in C
Data types in C
 
constants, variables and datatypes in C
constants, variables and datatypes in Cconstants, variables and datatypes in C
constants, variables and datatypes in C
 
Typedef
TypedefTypedef
Typedef
 
Numeric Data Types & Strings
Numeric Data Types & StringsNumeric Data Types & Strings
Numeric Data Types & Strings
 
Structures in c language
Structures in c languageStructures in c language
Structures in c language
 
Data types
Data typesData types
Data types
 
cs8251 unit 1 ppt
cs8251 unit 1 pptcs8251 unit 1 ppt
cs8251 unit 1 ppt
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 

Similar to Numerical data.

Lecture_01.2.pptx
Lecture_01.2.pptxLecture_01.2.pptx
Lecture_01.2.pptx
RockyIslam5
 
Sharbani bhattacharya VB Structures
Sharbani bhattacharya VB StructuresSharbani bhattacharya VB Structures
Sharbani bhattacharya VB Structures
Sharbani Bhattacharya
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
Mufaddal Nullwala
 
Data structures using C
Data structures using CData structures using C
Data structures using C
Pdr Patnaik
 
Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02
Salman Qamar
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
line24arts
 
Data structures cs301 power point slides lecture 01
Data structures   cs301 power point slides lecture 01Data structures   cs301 power point slides lecture 01
Data structures cs301 power point slides lecture 01
shaziabibi5
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
vrickens
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
LakshmiSarvani6
 
Ds
DsDs
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
tcsonline1222
 
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
mukeshgarg02
 
Introduction to Data Structures, Data Structures using C.pptx
Introduction to Data Structures, Data Structures using C.pptxIntroduction to Data Structures, Data Structures using C.pptx
Introduction to Data Structures, Data Structures using C.pptx
poongothai11
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
J. C.
 
Introduction to objects and inputoutput
Introduction to objects and inputoutput Introduction to objects and inputoutput
Introduction to objects and inputoutput
Ahmad Idrees
 
Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Hub102 - JS - Lesson3
Hub102 - JS - Lesson3
Tiểu Hổ
 
Excel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment me
joney4
 
Oo ps exam answer2
Oo ps exam answer2Oo ps exam answer2
Oo ps exam answer2
Kaushal Vaishnav
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
skilljiolms
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
Abdul salam
 

Similar to Numerical data. (20)

Lecture_01.2.pptx
Lecture_01.2.pptxLecture_01.2.pptx
Lecture_01.2.pptx
 
Sharbani bhattacharya VB Structures
Sharbani bhattacharya VB StructuresSharbani bhattacharya VB Structures
Sharbani bhattacharya VB Structures
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
 
Data structures using C
Data structures using CData structures using C
Data structures using C
 
Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02Ds12 140715025807-phpapp02
Ds12 140715025807-phpapp02
 
Introduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptxIntroduction to Data structure and algorithm.pptx
Introduction to Data structure and algorithm.pptx
 
Data structures cs301 power point slides lecture 01
Data structures   cs301 power point slides lecture 01Data structures   cs301 power point slides lecture 01
Data structures cs301 power point slides lecture 01
 
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docxJLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
JLK Chapter 5 – Methods and ModularityDRAFT January 2015 Edition.docx
 
Introduction to Data Science With R Notes
Introduction to Data Science With R NotesIntroduction to Data Science With R Notes
Introduction to Data Science With R Notes
 
Ds
DsDs
Ds
 
PPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptxPPt Revision of the basics of python1.pptx
PPt Revision of the basics of python1.pptx
 
data science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdfdata science with python_UNIT 2_full notes.pdf
data science with python_UNIT 2_full notes.pdf
 
Introduction to Data Structures, Data Structures using C.pptx
Introduction to Data Structures, Data Structures using C.pptxIntroduction to Data Structures, Data Structures using C.pptx
Introduction to Data Structures, Data Structures using C.pptx
 
Chapter2pp
Chapter2ppChapter2pp
Chapter2pp
 
Introduction to objects and inputoutput
Introduction to objects and inputoutput Introduction to objects and inputoutput
Introduction to objects and inputoutput
 
Hub102 - JS - Lesson3
Hub102 - JS - Lesson3Hub102 - JS - Lesson3
Hub102 - JS - Lesson3
 
Excel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment meExcel analysis assignment this is an independent assignment me
Excel analysis assignment this is an independent assignment me
 
Oo ps exam answer2
Oo ps exam answer2Oo ps exam answer2
Oo ps exam answer2
 
VCE Unit 01 (2).pptx
VCE Unit 01 (2).pptxVCE Unit 01 (2).pptx
VCE Unit 01 (2).pptx
 
Data structure and algorithm.
Data structure and algorithm. Data structure and algorithm.
Data structure and algorithm.
 

Recently uploaded

Shallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptxShallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptx
Gokturk Mehmet Dilci
 
Oedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptxOedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptx
muralinath2
 
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptxBREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
RASHMI M G
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
University of Maribor
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
AbdullaAlAsif1
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
University of Hertfordshire
 
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
David Osipyan
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
Sérgio Sacani
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
Sérgio Sacani
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
terusbelajar5
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
KrushnaDarade1
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
pablovgd
 
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptx
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptxANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptx
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptx
RASHMI M G
 
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Ana Luísa Pinho
 
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
University of Maribor
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
yqqaatn0
 
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
University of Maribor
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
moosaasad1975
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
TinyAnderson
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
University of Rennes, INSA Rennes, Inria/IRISA, CNRS
 

Recently uploaded (20)

Shallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptxShallowest Oil Discovery of Turkiye.pptx
Shallowest Oil Discovery of Turkiye.pptx
 
Oedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptxOedema_types_causes_pathophysiology.pptx
Oedema_types_causes_pathophysiology.pptx
 
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptxBREEDING METHODS FOR DISEASE RESISTANCE.pptx
BREEDING METHODS FOR DISEASE RESISTANCE.pptx
 
Randomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNERandomised Optimisation Algorithms in DAPHNE
Randomised Optimisation Algorithms in DAPHNE
 
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
Unlocking the mysteries of reproduction: Exploring fecundity and gonadosomati...
 
Applied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdfApplied Science: Thermodynamics, Laws & Methodology.pdf
Applied Science: Thermodynamics, Laws & Methodology.pdf
 
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
3D Hybrid PIC simulation of the plasma expansion (ISSS-14)
 
The binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defectsThe binding of cosmological structures by massless topological defects
The binding of cosmological structures by massless topological defects
 
The debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically youngThe debris of the ‘last major merger’ is dynamically young
The debris of the ‘last major merger’ is dynamically young
 
Medical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptxMedical Orthopedic PowerPoint Templates.pptx
Medical Orthopedic PowerPoint Templates.pptx
 
SAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdfSAR of Medicinal Chemistry 1st by dk.pdf
SAR of Medicinal Chemistry 1st by dk.pdf
 
NuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyerNuGOweek 2024 Ghent programme overview flyer
NuGOweek 2024 Ghent programme overview flyer
 
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptx
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptxANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptx
ANAMOLOUS SECONDARY GROWTH IN DICOT ROOTS.pptx
 
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
Deep Behavioral Phenotyping in Systems Neuroscience for Functional Atlasing a...
 
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
Comparing Evolved Extractive Text Summary Scores of Bidirectional Encoder Rep...
 
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
如何办理(uvic毕业证书)维多利亚大学毕业证本科学位证书原版一模一样
 
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
Remote Sensing and Computational, Evolutionary, Supercomputing, and Intellige...
 
What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.What is greenhouse gasses and how many gasses are there to affect the Earth.
What is greenhouse gasses and how many gasses are there to affect the Earth.
 
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdfTopic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
Topic: SICKLE CELL DISEASE IN CHILDREN-3.pdf
 
Deep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless ReproducibilityDeep Software Variability and Frictionless Reproducibility
Deep Software Variability and Frictionless Reproducibility
 

Numerical data.

  • 2. F a j u k o M i c h a e l A d e w u m i E z e k i e l E t u k u d o A n d y A f i a K e n n e d y
  • 3.
  • 4. ORDER OF PRESENTATION ETUKUDO ANDY-will introduce the project and talk on the order in which the project will be presented and also give a brief knowledge about his contribution in the group for five (5) minutes. ADEWUMI EZEKIEL- will present the project titled “NUMERICAL DATA” and also give a brief knowledge about his contribution in the group for seven (7) minutes. FAJUKO MICHEAL-will run the program that concerns the project and also give a brief knowledge about his contribution to the group for seven (7) minutes. Finally, AFIA KENNEDY-will talk on the conclusion and how the project relates to our previous lectures and also give a brief knowledge about his contribution to the group for five (5) minutes.
  • 5.
  • 6. b y Etukud o A nd y
  • 7. Arithmetic expression is a valid arrangement of variables, constants , operators ,operands and parentheses. e.g This an expression=x²-(4bc) where x=variables B and c=constants -sign =operators ()sign=parenthesis 4=operands There are five (5) operations in arithmetic expression that can be written in java the arithmetic operators are: Addition(+) Subtraction(-) Multiplication(*) Division(/) Modulo division (%)
  • 8. The Evaluation of the Arithmetic Expression in java is shown below; •10+25=35 •50-15=35 •6*3=18 •25/5=5 •9%2=1
  • 9.
  • 10. Precedence Rule When two or more operators are present in an expression, we determine the order of evaluation by following the precedence rules. Order of Precedence Bracket( ) Unary operators such as minors sign (-) and plus sign (+) Multiplication operator such as multiplication (*), Division (/) and modulo division (%) Additive operator such as minors(-) and addition(+) I call it BUMA
  • 11. Example 1 6 + ((37 % 8) / 5) = 6 + ( 5 / 5) = 7 Evaluate (7 * (10 - 5) % 3) * 4 + 9 (7 * 5 % 3) * 4 + 9 (35 % 3) * 4 + 9 2 * 4 + 9 8 + 9 17
  • 12. 1. Write the source code in a .java file 2. Compile the source code into byte code creating a .class file 3. JVM interprets the byte code into machine language as 1s and 0s and the computer then executes the instructions
  • 14. The Math class is a type of standard class in the java.lang package. The Math class contains methods that perform various mathematical functions. Example: Square Root a = Math.sqrt(9.0) a would receive the value of 3. Example: Exponents a = Math.pow(4.0, 2.0) a would receive the value of 16. where Math is the class, pow is the method and the rest are the parameters.
  • 15. Mathematical Syntax Operation Java Description Math.sqrt(x) square root of x Math.pow(x, y) x raised to the exponent y Math.abs(x) absolute value of x Some Math Class Methods
  • 16. 16 ( ( ( Math.pow( ( ( 1 + Math.sqrt( 5 ) ) / 2 ),fibonacciNum ) ) - ( Math.pow( ( ( 1- Math.sqrt( 5 ) ) / 2 ), fibonacciNum ) ) ) / Math.sqrt( 5 ) ); Write a formula with the use of mathclass method that accepts N and displays FN.
  • 17.
  • 18.
  • 19. The DecimalFormat class (which is part of the java.text package) is one way to format numbers. To format a number using the DecimalFormat class, a number of steps are required. In the following example, we will format a number to two decimal places.
  • 20. 1. Import the java.text.DecimalFormat class. import java.text.DecimalFormat; 2. Now you must create a DecimalFormat object to format the text according to a pattern that you specify. // Declare and initialize DecimalFormat object DecimalFormat df = new DecimalFormat(“.00”); df is the name given to the DecimalFormat object we have created # is a placeholder object that will be removed if there is not a digit at that location 0 is a placeholder that will show up as zero if a digit is not found at that location 3. Now we can use the DecimalFormat object to format your number. System.out.println(df.format(234.5678)); The above expression outputs 234.57. The format pattern #.00 asks that a number be converted into four characters – i.e. one digit to the left of the decimal separator, a decimal separator, and two digits on the right.
  • 21. 21 DecimalFormat decFor = new DecimalFormat(String pattern); If I wanted to format the number to zero decimal places, my DecimalFormat object would be created as follows: DecimalFormat df = new DecimalFormat(“#”); System.out.println(df.format(234.5678)); The above program would output the number 234.5678 would be outputted as 235. class parameterVariable name
  • 22. EXAMPLE import java.text.DecimalFormat; class Deci { public static void main(String args[]) { //formatting numbers up to 2 decimal places in Java DecimalFormat df = new DecimalFormat("######.00"); System.out.println(df.format(364565.14)); //formatting numbers up to 3 decimal places in Java df = new DecimalFormat("######.000"); System.out.println(df.format(364565.14)); } }
  • 23. It will display something like this;
  • 24.
  • 25. •The input returned from the input dialog box is a string. If you enter a numeric value such as 123, it returns “123”. To obtain the input as a number, you have to convert a string into a number. •To convert a string into an int value, you can use the static parseInt method in the Integer class as follows: int intValue = Integer.parseInt(intString); •where intString is a numeric string such as “123”.
  • 26. To convert a string into a double value, you can use the static parseDouble method in the Double class as follows: double doubleValue =Double.parseDouble(doubleString); where doubleString is a numeric string such as “123.45”.
  • 27.
  • 28. It is an open code and ready to supply input data. Typically it corresponds to keyboard input or another input source specified by the user. System.in means by inputting the attributes and method or data. NOTE -The data collected by the system.in object is character data, even if they are entered as numeric digits. Therefore if the application performs any calculation, the input character, it must first be converted to primitive data type before it is used.
  • 29. It is an open and ready to accept output data. Typically it corresponds to display output or another output destination specified by the user. Writing character to the system.out using method print() or print() displays these character on your screen.
  • 30.
  • 31.
  • 32. 32 GregorianCalendar class is a type of standard class used for manipulating calendar information such as year, month, day, hour, minute and second from a Date object..  Firstly, identifying the package in which a class belongs is very important Therefore  (Java.util.Gregorian-Calendar is a concrete subclass of Calendar);
  • 33. 33 However they are constant defined in the calendar class for retrieving different fragment of calendar/time which are; Parameters and Constant defined year - the value used to set the YEAR time field in the calendar. month - the value used to set the MONTH time field in the calendar. Month value is 0-based. e.g., 0 for January. WEEK-the constant value for the days of week. date - the value used to set the DATE time field in the calendar. hour - the value used to set the HOUR_OF_DAY time field in the calendar.
  • 34.  How to Constructs a GregorianCalendar with given date and time set for the default time GregorianCalendar today = new GregorianCalendar( ); public GregorianCalendar (int year, int month, int date, int hour, int minute, int second)
  • 35. And it is possible to create a new GregorianCalendar object that represents today as Or specifically presenting the day as January7, 2014, by passing year, month, and day as the parameters e.g.  GregorianCalendar independenceDay = new GregorianCalendar (2014, 3, 7);  The value of 3 in the second parameter means April because the value of the January is 0; and the value of February which is the second month of the year is 1 so therefore; the, value of April is 3
  • 36.
  • 37.
  • 38. 38 Java Data Types object array interface class primitive integral boolean byte char short int long floating point float double
  • 39.  When a new Data values is created, Java allocates space from a pool of memory called the stack to the variables
  • 40. Java Primitive Data Types  Primitive data value is also known as (numerical data value) used to compute the sum and the difference of variables (x and y) in a Java program  we must first declare what kind of data will be assigned to them after assigning values to them, then computing their sum and difference is made possible, to declare that the type of data assigned to them is an integer, we write  int x, y;
  • 41. After declaration is made, memory is allocated to store data values for x and y.  These memory locations are called variables, and x and y are the names we associate with the memory locations. When declaration is made, we can assign only integers to x and y but not real numbers.  However there are six numerical data types in Java: byte, short, int, long, float, and double.
  • 42.  The difference among these six numerical data types are their range of values they can represent  Also a data type with a larger range of values is said to have a higher precision data type.  Double has a higher precision than the data type float.
  • 43.  Memory size for data types Every data type has some memory size defined. This enables that whenever a variable is declared, the memory size is automatically defined  Default value: Every primitive data type has default values defined. When the programmer does not declare to assign any values to the variables, these default values will be assigned by the Virtual machine during the object instantiation.  Range of values the data types can represent It is extremely important to understand what are the min and max range of values a data type can be able to hold.
  • 44. This is syntax for declaring primitive data value <data type> <variables>; num1 38 num2 96 Before: num2 = num1; num1 38 num2 38 After: Int number1,number2; number1 = 138; number2 = number1 When number2 is declared as a variable it overwrite the reference in number1
  • 45. Object Data type These are also variables (they can be change) but the only difference is the content because a variable in an object contains an address where the object is stored. Without executing a new command, no new object is created, two variables can refer to the same object as the object having two distinct names  Before a memory is allocated to an object in a program, it must be declared and initialized An object declaration simply declares the name (identifier) that is used to refer to an object. Where <object names> is a sequence of object names separated by commas and <Class name> is the name of a class to which these objects belongs. The name of an object and the class to which the object belongs
  • 46. This is the syntax for object declaration: <Class name> <object names>;  When an address of an object is executed and memory space is allocated  When the class of an object is executed there’s a space memory allocated to it
  • 47. For object name2 = name1; name1 name2 Before: "Steve Jobs" "Steve Wozniak" name1 name2 After: "Steve Jobs"
  • 48. From the open book test, we have been drilled to read and understand the concept of java in chapter two of McGraw introduction to java. From the first topic, we learnt about the six programming phases which are; understand the program, Plan the logic, Code the program, Test the program etc and this was used while practicing and working out the java program for each of the bullet point in question. Class is also the template in object-oriented programming and it can also be related to pseudocode.