FinCheck Variables, Data Types & Operators Implementation
Business Scenario
After successfully understanding Java Program Structure and Console Output inside the FinCheck Project, your manager now assigns you responsibility for handling Transaction-Related Testing Data using Java Variables and Operators.
During testing activities, QA Testers frequently work with :-
Customer Names
Account Numbers
Transaction Amounts
Transaction Status Values
Recently, new QA Team Members were unable to understand how Application Data is stored and processed inside Java Programs.
Because of this, testers were making mistakes while validating Balances and Transaction
Outputs.
Before starting testing activities, your manager clearly says :-
“If a QA Tester cannot understand how Data is stored and calculated inside Java Programs, Validation Logic becomes difficult to understand. “”
Your responsibility is to understand :-
How Variables Store Testing Data
How Different Data Types Work
How Operators Perform Calculations
How Transaction Balances are Updated
How Java Programs Process Validation Values
Pre-Lab Preparation
Task 1: Understand Variables in Java
Understand & Create Variables
a
What is Variable?
Variable is a storage container used to store data inside Java programs.
QA testers use variables to store :-
customer names
account numbers
transaction amounts
balances
validation results
How Variables Work
Tester creates variable.
Value gets stored inside memory.
Program uses stored value during execution.
Stored value displays inside console output.
Real Life Example
Tester stores :-
customer name = Rahul
account number = 101001
transaction amount = 5000
inside Java variables.
Syntax
VARIABLE DECLARATION AND ASSIGN SYNTAX
Activity
Create Java class
Create variables inside main method
Store customer information
Print stored values
Task 2: Understand Java Data Types
Understand & create Data Types
a
What is Data Type?
Data type defines what kind of value a variable can store inside Java program.
Different testing data requires different data types.
Types of Java Data Types
Primitive Data Types
Primitive data types store simple values directly inside memory.
Types of primitive Data Types
boolean
Stores true or false values.
char
Stores single character value.
float
Stores decimal values with smaller precision.
double
Stores decimal values with larger precision.
Stores very small whole numbers.
Stores small numeric values.
Stores whole numbers.
Stores very large whole numbers.
Non primitive Data Types
Non-primitive data types store multiple values or complex information.
Types of non-primitive Data Types
String
Stores text values.
Array
Stores multiple values inside single variable.
Class
Used to create objects and program structure.
Real Life Example
Tester stores :-
customer name using String
transaction amount using int
balance using double
Syntax
Refer variable declaration syntax
Activity
Create variables using multiple data types
Store transaction values
Print stored output
Task 3: Understand Java Operators
Understand Operators
a
What are Operators?
Operators are symbols used to perform calculations and operations inside Java programs.
QA testers use operators during :-
balance calculations
transaction validations
amount verification
testing logic execution
Types of Operators
Arithmetic Operator
Arithmetic operators are used to perform mathematical calculations inside Java programs.
Types of Arithmetic Operators
Addition Operator (+)
Subtraction Operator (-)
Multiplication Operator (*)
Division Operator (/)
Modulus Operator (%)
Comparison Operators
Comparison operators are used to compare two values.
These operators return result as :- true or false
Types of Comparison Operators
Equal To Operator (==)
Greater Than Operator (>)
Less Than Operator (<)
Greater Than Equal To (>=)
Less Than Equal To (<=)
Logical Operators
Logical operators are used to combine multiple conditions.
Types of Logical Operators
2. OR Operator (||)
At least one condition must be true otherwise if all conditions are false then end result will be false
1. AND Operator (&&)
Both Condition must be true then end result will be true otherwise always it will be false
NOT Operator (!)
Reverses the result
Real Life Example
Customer balance = 10000
Withdrawal amount = 2000
Updated balance = 8000
Activity
Create balance variable
Create withdrawal amount variable
Perform subtraction operation
Display updated balance
Task 4: Perform Transaction Calculations
Understand Transaction Calculations
a
What is Transaction Calculation?
Transaction calculation means updating balance after debit or credit transaction.
Banking applications perform calculations whenever transaction occurs.
Types of Transaction Calculations
Debit Calculation
Amount gets deducted from balance.
Credit Calculation
Amount gets added to balance.
How Transaction Calculation Works
System reads current balance.
Transaction amount gets processed.
Updated balance gets calculated.
Output displays inside console.
Real Life Example
Current balance = 15000
Debit amount = 5000
Remaining balance = 10000
Activity
Debit Transaction
Create balance variable
Create debit amount variable
Create remaining balance variable
Perform subtraction calculation
Store calculation value into remaining balance variable
Display remaining balance
Activity
Credit Transaction
Create balance variable
Create credit amount variable
Create update balance variable
Perform addition calculation
Store calculation value into update balance variable
Display updated balance
Good Job!!
In this lab, you learned Java Variables, Data Types, and Operators used for transaction calculations and validations.
You also practiced Storing Transaction Data, performing Calculations, and Verifying Console Output.
By completing this lab, you now understand how QA Testers Handle Data and Validate Transaction Outputs using Java.
Checkpoint
Next-Lab Preparation
Git Push
git push origin branchName