Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4,6 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.

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

Written for

Institution
Schooljaar
200

Document information

Uploaded on
July 26, 2022
Number of pages
5
Written in
2020/2021
Type
SUMMARY
R150,00
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF


Document also available in package deal

Thumbnail
Package deal
IEB IT Practical Exam Notes
-
6 2 2022
R 250,00 More info

Reviews from verified buyers

Showing all reviews
3 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
View profile
Follow You need to be logged in order to follow users or courses
Sold
23
Member since
6 year
Number of followers
16
Documents
7
Last sold
8 months 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

Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

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

Student with book image

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

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions