100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary IEB IT Java Notes

Rating
3.0
(1)
Sold
2
Pages
5
Uploaded on
26-07-2022
Written in
2020/2021

This document outlines approaches to everything required for the IEB IT Java Practical Examination. These notes were developed by a candidate in the Top 1% in the IEB for Information Technology in 2020.

Institution
Course









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Course
Schooljaar
200

Document information

Uploaded on
July 26, 2022
Number of pages
5
Written in
2020/2021
Type
Summary

Subjects

Content preview

Java Coding Notes

Typecasting
String → int
int num = Integer.parseInt (Str);

String → double
double num = Double.parseDouble (Str);

double → int
int intNum = (int) dblNum;

int → double
double dblNum = intNum;

int → char (Converts to ASCII Value)
char ch = (char) intNum;

char → int (Converts to ASCII Number)
int intNum = (int) ch;

int → String
String str = “ ” + intNum;

double → String
String str = “ ” + dblNum;

String → char
char ch = str.charAt(index);
.toUpperCase() or .toLowerCase()

char → String
String str = “ ” + ch;

Formatting and Arithmetic
Constants / Finals:
public/private static final <type> <name> = <value>;

Useful Tools:
String.format("%.2f", <double>); round off to 2 decimals
System.arraycopy (<sourceArr>, <sourcePos>, <destArr>, <destPos>, <size>); copy
part of an array into another array

Math Class:
Square Root: Math.sqrt (x)
Raise to Power: Math.pow (x, exponent)
Round off: Math.round (x)
Absolute Value: Math.abs (-x)
Random Number: Math.random () * (max) + (start)

Nikhar Ramlakhan © Page 1 of 5

, Java Coding Notes

Array Handling
Declaring an array:
[variable type] [variable name] [] = new [variable type] [size];


Inputting an array with a known amount of values:
int array [] = new int [10];
for (int loop = 0; loop < 10; loop++){
array [loop] = [input method];
}//end for loop

Inputting an array with an unknown amount of values:
int count = 0;
String wrdArr [] = new String [10]
wrdArr [count] = [input method];
while (!wrdArr [count].equalsIgnoreCase (“stop”)){
count++;
wrdArr [count] = [input method]
}//end while loop

Displaying an array:
for (int loop = 0; loop < [size]; loop++){
System.out.println (array [loop]);
}//end for loop


Inserting into an array:
public void shiftRight (int insertPos, String newString){
for (int loop = size; loop > insertPos; loop--){
stArr [loop + 1] = stArr [loop];
}//end for loop
stArr [insertPos] = newString;
size++;
}//shiftRight insert method

Deleting from an array
public void shiftLeft (int removePos){
for (int loop = removePos; loop < size; loop++){
stArr [loop] = stArr [loop + 1];
}//end for loop
size--;
}//shiftLeft delete method
Or you can just override the deleted array index with the last index and call a
sort method.



Nikhar Ramlakhan © Page 2 of 5
$9.16
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached


Also available in package deal

Reviews from verified buyers

Showing all reviews
2 year ago

3.0

1 reviews

5
0
4
0
3
1
2
0
1
0
Trustworthy reviews on Stuvia

All reviews are made by real Stuvia users after verified purchases.

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
NikharRamlakhan Trinityhouse High
Follow You need to be logged in order to follow users or courses
Sold
23
Member since
5 year
Number of followers
16
Documents
7
Last sold
1 month ago
Tech Support

An experienced programmer and IT enthusiast with a goal of explaining difficult IT concepts in simpler terms!

3.5

2 reviews

5
0
4
1
3
1
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions