In this chapter we will discuss exceptions in the object-oriented programming and in Java in particular. We will learn how to handle exceptions using the try-catch construct, how to pass them to the calling methods and how to throw standard or our own exceptions using the throw construct.
DEF CON 23 - Atlas - fun with symboliksFelipe Prado
This document provides an introduction to symbolik analysis using Vivisect, a binary analysis framework. It discusses key concepts like symbolic emulation, symbolic effects, constraints, graph theory, and reduction. Examples are given of how symbolik analysis can be used for tasks like identifying register traversal ROP gadgets, solving switch/case statements, and aiding the discovery of 0-day vulnerabilities through techniques like input substitution. The document encourages experimenting with Vivisect's Python API to further understand and apply symbolic analysis.
The document provides an outline of topics for a C/C++ tutorial, including a "Hello World" program, data types, variables, operators, conditionals, loops, arrays, strings, functions, pointers, command-line arguments, data structures, and memory allocation. It gives examples and explanations of key concepts in C/C++ programming.
Control statements allow different sets of instructions to be executed depending on logical conditions through branching and looping. Common control structures include if/else for conditional branching and while, do-while, for loops for repetition. These structures use relational, logical, and arithmetic operators to evaluate conditions that determine the flow of program execution.
This document discusses pointers and arrays in C programming. It begins by explaining that an array stores multiple elements of the same type in contiguous memory locations, while a pointer variable stores the address of another variable. It then provides examples of how to declare and initialize arrays and pointers, pass arrays to functions, and perform operations like pointer arithmetic on arrays using pointers. The key advantages of arrays like storing multiple values and accessing elements using indexes are also summarized.
This document discusses pointers and arrays in C programming. It begins by explaining that an array stores multiple elements of the same type in contiguous memory locations, while a pointer variable stores the address of another variable. It then provides examples of how to declare and initialize arrays and pointers, pass arrays to functions, and perform operations like pointer arithmetic on arrays using pointers. The key advantages of arrays like storing multiple values and accessing elements using indexes are also summarized.
In this chapter we will understand how to define custom classes and their elements. We will learn to declare fields, constructors and properties for the classes. We will revise what a method is and we will broaden our knowledge about access modifiers and methods.
This document discusses functional domain-driven design and the use of monads. It begins by stating that functional domain-driven design is still a work in progress. It then provides definitions of monads and functions as they relate to category theory. The document discusses how monads can be used with a functional approach to domain-driven design. It also includes brief biographical information about the software developer who posted this content.
In this chapter we will discuss exceptions in the object-oriented programming and in Java in particular. We will learn how to handle exceptions using the try-catch construct, how to pass them to the calling methods and how to throw standard or our own exceptions using the throw construct.
DEF CON 23 - Atlas - fun with symboliksFelipe Prado
This document provides an introduction to symbolik analysis using Vivisect, a binary analysis framework. It discusses key concepts like symbolic emulation, symbolic effects, constraints, graph theory, and reduction. Examples are given of how symbolik analysis can be used for tasks like identifying register traversal ROP gadgets, solving switch/case statements, and aiding the discovery of 0-day vulnerabilities through techniques like input substitution. The document encourages experimenting with Vivisect's Python API to further understand and apply symbolic analysis.
The document provides an outline of topics for a C/C++ tutorial, including a "Hello World" program, data types, variables, operators, conditionals, loops, arrays, strings, functions, pointers, command-line arguments, data structures, and memory allocation. It gives examples and explanations of key concepts in C/C++ programming.
Control statements allow different sets of instructions to be executed depending on logical conditions through branching and looping. Common control structures include if/else for conditional branching and while, do-while, for loops for repetition. These structures use relational, logical, and arithmetic operators to evaluate conditions that determine the flow of program execution.
This document discusses pointers and arrays in C programming. It begins by explaining that an array stores multiple elements of the same type in contiguous memory locations, while a pointer variable stores the address of another variable. It then provides examples of how to declare and initialize arrays and pointers, pass arrays to functions, and perform operations like pointer arithmetic on arrays using pointers. The key advantages of arrays like storing multiple values and accessing elements using indexes are also summarized.
This document discusses pointers and arrays in C programming. It begins by explaining that an array stores multiple elements of the same type in contiguous memory locations, while a pointer variable stores the address of another variable. It then provides examples of how to declare and initialize arrays and pointers, pass arrays to functions, and perform operations like pointer arithmetic on arrays using pointers. The key advantages of arrays like storing multiple values and accessing elements using indexes are also summarized.
In this chapter we will understand how to define custom classes and their elements. We will learn to declare fields, constructors and properties for the classes. We will revise what a method is and we will broaden our knowledge about access modifiers and methods.
This document discusses functional domain-driven design and the use of monads. It begins by stating that functional domain-driven design is still a work in progress. It then provides definitions of monads and functions as they relate to category theory. The document discusses how monads can be used with a functional approach to domain-driven design. It also includes brief biographical information about the software developer who posted this content.
This document discusses pointcuts and static analysis in aspect-oriented programming. It provides an example of using aspects to ensure thread safety in Swing by wrapping method calls in invokeLater. It proposes representing pointcuts as relational queries over a program representation, and rewriting pointcuts as Datalog queries for static analysis. Representing programs and pointcuts relationally in this way enables precise static analysis of crosscutting concerns.
This document provides concepts to memorize for the Oracle Certificate Associate Java 7 exam. It includes summaries of topics like default constructors, legal vs illegal class declarations, interfaces, methods, numbers, floating point numbers, boxing and unboxing, literals, operators, strings, arrays, collections, loops, and common mistakes. The document is from a personal note and is not an official Java course, but rather concepts to commit to memory for the exam. It cites three books as references for additional study material.
This document discusses strategies for throwing better exceptions in code. It presents examples of poorly thrown exceptions and demonstrates how to improve them by including more context and details. The key rules discussed are to use variable values, wrap bad exceptions, provide context, show runtime details, include tl;dr examples, add extra information, and highlight root causes when throwing exceptions. This aims to give confused coders more guidance in debugging and understanding where errors are occurring.
The document describes data flow modeling in VHDL. It discusses how data flow style architecture models hardware in terms of the movement of data over continuous time between combinational logic components. It also describes how concurrent signal assignment statements can be used to model simple combinational logic. Examples provided include half adder, full adder, comparator, multiplexer, decoder, and arithmetic logic unit designs modeled using data flow style and concurrent signal assignments.
This document discusses JavaScript obfuscation techniques:
- JavaScript obfuscation involves hiding the intended meaning of code to make it confusing and difficult to interpret. An example of obfuscated code is provided.
- Obfuscation can be used to bypass web application firewalls, filters, and hide implementation details. It relies on JavaScript's loosely typed nature and ability to use non-alphanumeric characters.
- The document outlines various obfuscation techniques including using strings, operators, comments, encoding, and interacting with browser objects. It also provides tips on de-obfuscating code by replacing document.write with alert.
The document discusses various aspects of arrays in C programming language. It defines arrays as collections of similar data types stored in contiguous memory locations. It describes single dimensional and multi-dimensional arrays. It also discusses array declaration and initialization syntax. Some key points covered are: advantages of arrays over single variables, accessing array elements using indexes, passing arrays to functions, and two dimensional or 2D arrays also called matrices.
The Ring programming language version 1.5 book - Part 6 of 31Mahmoud Samir Fayed
The document provides documentation on Ring programming language functions for checking data types, objects, classes, and packages. It describes functions such as isglobal(), isfunction(), packages(), classname(), objectid(), isobject(), attributes(), methods(), addattribute(), and packagename(). Each function is explained with its syntax and examples showing how to use the function to check types, retrieve object and class information, modify objects, and more.
System Verilog (Tutorial -- 4X1 Multiplexer)Denise Wilson
This document describes building a 4x1 multiplexer in System Verilog using 2x1 multiplexer modules. It includes lower and higher level modules, with the lower being a 2x1 multiplexer and the higher being a 4x1 multiplexer built from three 2x1 multiplexers. A testbench module is also included to simulate the 4x1 multiplexer in ModelSim and verify its functionality.
The document contains questions about Java programming concepts like operators, conditional statements, Boolean expressions, and formatting output. It asks the reader to evaluate code snippets, rewrite code using different structures like switch statements, and explain the behavior of code based on different inputs. Several questions also ask the reader to write code to solve problems using concepts like random number generation and conditional logic.
This document provides a summary of key concepts from a lecture on C programming:
1) It reviews basic C concepts like variables, data types, operators, expressions, and functions. It defines terms like datatypes, operators, expressions, and variables.
2) It describes different C data types including numeric, character, and user-defined types. It explains integer sizes and representations like big-endian vs little-endian.
3) It covers various C operators for arithmetic, relational comparisons, logic, increment/decrement, bitwise operations, and assignment. It provides examples of how each operator is used.
Presentation at NY Scala Enthusiasts Meetup on 6/14/2010. Covers techniques for using Scala's flexible syntax and features to design internal DSLs and wrappers.
Random stability in systemVerilog and UVM based testbenchKashyap Adodariya
All about random stability in sv and UVM based testbench including examples. Represent through example and dig. Also explain how any process get seed for randomize.
The C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.
The C is the most widely used computer language, it keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.
The document discusses various types of arrays in Java, including one-dimensional arrays, multi-dimensional arrays, and jagged arrays. It explains how to declare, initialize, access, and pass array elements. Key points include that arrays are dynamically allocated objects that can store primitive values or objects, arrays inherit from Object and implement Serializable and Cloneable, and the class name of an array returns [ followed by the data type (e.g. [I for int array). The document also demonstrates various array examples using for loops and exceptions like ArrayIndexOutOfBoundsException.
This document provides an overview of writing clean code, focusing on readability, code style, naming conventions, code comments, control structures, functions/methods, classes, and modules. Key points include formatting code for readability, using explicit and descriptive naming, minimizing comments by ensuring code is self-explanatory, limiting nested control structures and side effects, following single responsibility and encapsulation principles, and leveraging software patterns.
Good and Bad Code
The Broken Window Theory
The Grand Redesign in the Sky
The Sushi Chef Rule
The Hotel Room Rule
The Boy Scout Rule
OOP Patterns and Principles
SOLID Principles
How to measure clean code?
Tools
This document discusses methods (also called subroutines or functions) in computer programming. It explains that methods allow programmers to break programs into smaller pieces to make them more organized and reusable. The document covers declaring and creating methods, passing parameters to methods, and methods returning values. Examples are provided to demonstrate methods with parameters and methods that return values.
Javascript & jQuery: A pragmatic introductionIban Martinez
This document provides an introduction to Javascript and jQuery. It covers Javascript data types including numbers, strings, Booleans, null/undefined, and arrays. It then covers jQuery topics like jQuery objects, selectors, CSS manipulation, events including ready and load, and AJAX/JSON requests using both asynchronous and synchronous modes. It includes examples for working with numbers, strings, selectors, events, AJAX calls and shortcuts. The document aims to provide a pragmatic introduction to Javascript and jQuery concepts and functionality.
1. The document describes a hospital management project created in Java to keep records of patients' information like BP, weight, case number, etc. and allow printing prescriptions and bills.
2. It includes coding for a splash screen, login frame, two admin forms for adding/deleting users, and frames for registering new patients, deleting patient accounts, and viewing pending patients.
3. The coding connects to a Java database, implements prepared statements to query and update tables storing user passwords and patient data, and uses various Swing components like text fields and buttons.
The document contains the solutions to 64 programming problems in Java. It provides the code to write programs that can:
1) Display patterns like right angle triangles and pyramids with numbers.
2) Check if a number is negative, zero or positive.
3) Sort arrays and insert or find elements in arrays.
4) Perform operations like calculating averages and separating even/odd numbers in arrays.
3) Find pair sums and rotate/add matrices.
The document provides code to implement the Hill cipher encryption and decryption algorithm in Java. It includes:
1. Defining a 3x3 key matrix and inverse key matrix for encrypting/decrypting blocks of 3 characters.
2. Obtaining plaintext, padding it to the nearest multiple of 3 characters, and encrypting it by multiplying the plaintext vector by the key matrix.
3. Decrypting the ciphertext by multiplying the ciphertext vector by the inverse key matrix.
4. The code takes plaintext as input, encrypts it using the Hill cipher algorithm, then decrypts the ciphertext output to retrieve the original plaintext.
This document discusses pointcuts and static analysis in aspect-oriented programming. It provides an example of using aspects to ensure thread safety in Swing by wrapping method calls in invokeLater. It proposes representing pointcuts as relational queries over a program representation, and rewriting pointcuts as Datalog queries for static analysis. Representing programs and pointcuts relationally in this way enables precise static analysis of crosscutting concerns.
This document provides concepts to memorize for the Oracle Certificate Associate Java 7 exam. It includes summaries of topics like default constructors, legal vs illegal class declarations, interfaces, methods, numbers, floating point numbers, boxing and unboxing, literals, operators, strings, arrays, collections, loops, and common mistakes. The document is from a personal note and is not an official Java course, but rather concepts to commit to memory for the exam. It cites three books as references for additional study material.
This document discusses strategies for throwing better exceptions in code. It presents examples of poorly thrown exceptions and demonstrates how to improve them by including more context and details. The key rules discussed are to use variable values, wrap bad exceptions, provide context, show runtime details, include tl;dr examples, add extra information, and highlight root causes when throwing exceptions. This aims to give confused coders more guidance in debugging and understanding where errors are occurring.
The document describes data flow modeling in VHDL. It discusses how data flow style architecture models hardware in terms of the movement of data over continuous time between combinational logic components. It also describes how concurrent signal assignment statements can be used to model simple combinational logic. Examples provided include half adder, full adder, comparator, multiplexer, decoder, and arithmetic logic unit designs modeled using data flow style and concurrent signal assignments.
This document discusses JavaScript obfuscation techniques:
- JavaScript obfuscation involves hiding the intended meaning of code to make it confusing and difficult to interpret. An example of obfuscated code is provided.
- Obfuscation can be used to bypass web application firewalls, filters, and hide implementation details. It relies on JavaScript's loosely typed nature and ability to use non-alphanumeric characters.
- The document outlines various obfuscation techniques including using strings, operators, comments, encoding, and interacting with browser objects. It also provides tips on de-obfuscating code by replacing document.write with alert.
The document discusses various aspects of arrays in C programming language. It defines arrays as collections of similar data types stored in contiguous memory locations. It describes single dimensional and multi-dimensional arrays. It also discusses array declaration and initialization syntax. Some key points covered are: advantages of arrays over single variables, accessing array elements using indexes, passing arrays to functions, and two dimensional or 2D arrays also called matrices.
The Ring programming language version 1.5 book - Part 6 of 31Mahmoud Samir Fayed
The document provides documentation on Ring programming language functions for checking data types, objects, classes, and packages. It describes functions such as isglobal(), isfunction(), packages(), classname(), objectid(), isobject(), attributes(), methods(), addattribute(), and packagename(). Each function is explained with its syntax and examples showing how to use the function to check types, retrieve object and class information, modify objects, and more.
System Verilog (Tutorial -- 4X1 Multiplexer)Denise Wilson
This document describes building a 4x1 multiplexer in System Verilog using 2x1 multiplexer modules. It includes lower and higher level modules, with the lower being a 2x1 multiplexer and the higher being a 4x1 multiplexer built from three 2x1 multiplexers. A testbench module is also included to simulate the 4x1 multiplexer in ModelSim and verify its functionality.
The document contains questions about Java programming concepts like operators, conditional statements, Boolean expressions, and formatting output. It asks the reader to evaluate code snippets, rewrite code using different structures like switch statements, and explain the behavior of code based on different inputs. Several questions also ask the reader to write code to solve problems using concepts like random number generation and conditional logic.
This document provides a summary of key concepts from a lecture on C programming:
1) It reviews basic C concepts like variables, data types, operators, expressions, and functions. It defines terms like datatypes, operators, expressions, and variables.
2) It describes different C data types including numeric, character, and user-defined types. It explains integer sizes and representations like big-endian vs little-endian.
3) It covers various C operators for arithmetic, relational comparisons, logic, increment/decrement, bitwise operations, and assignment. It provides examples of how each operator is used.
Presentation at NY Scala Enthusiasts Meetup on 6/14/2010. Covers techniques for using Scala's flexible syntax and features to design internal DSLs and wrappers.
Random stability in systemVerilog and UVM based testbenchKashyap Adodariya
All about random stability in sv and UVM based testbench including examples. Represent through example and dig. Also explain how any process get seed for randomize.
The C is a general-purpose, procedural, imperative computer programming language developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the UNIX operating system.
The C is the most widely used computer language, it keeps fluctuating at number one scale of popularity along with Java programming language, which is also equally popular and most widely used among modern software programmers.
The document discusses various types of arrays in Java, including one-dimensional arrays, multi-dimensional arrays, and jagged arrays. It explains how to declare, initialize, access, and pass array elements. Key points include that arrays are dynamically allocated objects that can store primitive values or objects, arrays inherit from Object and implement Serializable and Cloneable, and the class name of an array returns [ followed by the data type (e.g. [I for int array). The document also demonstrates various array examples using for loops and exceptions like ArrayIndexOutOfBoundsException.
This document provides an overview of writing clean code, focusing on readability, code style, naming conventions, code comments, control structures, functions/methods, classes, and modules. Key points include formatting code for readability, using explicit and descriptive naming, minimizing comments by ensuring code is self-explanatory, limiting nested control structures and side effects, following single responsibility and encapsulation principles, and leveraging software patterns.
Good and Bad Code
The Broken Window Theory
The Grand Redesign in the Sky
The Sushi Chef Rule
The Hotel Room Rule
The Boy Scout Rule
OOP Patterns and Principles
SOLID Principles
How to measure clean code?
Tools
This document discusses methods (also called subroutines or functions) in computer programming. It explains that methods allow programmers to break programs into smaller pieces to make them more organized and reusable. The document covers declaring and creating methods, passing parameters to methods, and methods returning values. Examples are provided to demonstrate methods with parameters and methods that return values.
Javascript & jQuery: A pragmatic introductionIban Martinez
This document provides an introduction to Javascript and jQuery. It covers Javascript data types including numbers, strings, Booleans, null/undefined, and arrays. It then covers jQuery topics like jQuery objects, selectors, CSS manipulation, events including ready and load, and AJAX/JSON requests using both asynchronous and synchronous modes. It includes examples for working with numbers, strings, selectors, events, AJAX calls and shortcuts. The document aims to provide a pragmatic introduction to Javascript and jQuery concepts and functionality.
1. The document describes a hospital management project created in Java to keep records of patients' information like BP, weight, case number, etc. and allow printing prescriptions and bills.
2. It includes coding for a splash screen, login frame, two admin forms for adding/deleting users, and frames for registering new patients, deleting patient accounts, and viewing pending patients.
3. The coding connects to a Java database, implements prepared statements to query and update tables storing user passwords and patient data, and uses various Swing components like text fields and buttons.
The document contains the solutions to 64 programming problems in Java. It provides the code to write programs that can:
1) Display patterns like right angle triangles and pyramids with numbers.
2) Check if a number is negative, zero or positive.
3) Sort arrays and insert or find elements in arrays.
4) Perform operations like calculating averages and separating even/odd numbers in arrays.
3) Find pair sums and rotate/add matrices.
The document provides code to implement the Hill cipher encryption and decryption algorithm in Java. It includes:
1. Defining a 3x3 key matrix and inverse key matrix for encrypting/decrypting blocks of 3 characters.
2. Obtaining plaintext, padding it to the nearest multiple of 3 characters, and encrypting it by multiplying the plaintext vector by the key matrix.
3. Decrypting the ciphertext by multiplying the ciphertext vector by the inverse key matrix.
4. The code takes plaintext as input, encrypts it using the Hill cipher algorithm, then decrypts the ciphertext output to retrieve the original plaintext.
This document provides a summary of key Java concepts including keywords, packages, data types, and common data structures and algorithms. It includes tables that define Java keywords and their usage, standard Java packages, primitive data types and conversions between them, and collections and algorithms from the Java utilities package. The document also provides examples of using regular expressions, formatted output, and MessageFormat in Java.
This document summarizes the contents of the second day of a hands-on workshop on the Python programming language. It discusses indentation, the range function, for and while loops, conditional statements like if/elif, and modules for math, time, and random variables. Example code is provided to demonstrate various Python concepts like loops, logical operators, and comparisons between Python and C/C++ programming.
Write a program to check a given number is prime or notaluavi
The document contains 6 algorithms for solving different programming problems:
1. A program to check if a number is prime or not using a while loop.
2. A program to check if a number is a Krishnamurty number using factorial calculations in a while loop.
3. A recursive function to generate the Fibonacci series.
4. A program to print an array in reverse order using a for loop.
5. A program to merge two sorted arrays into a single sorted array using a while loop.
6. A program to check if a string is a palindrome without built-in functions by reversing the string and comparing the original and reversed strings.
Write a program Grader that that will be used by a program driver to.pdfarjunenterprises1978
Write a program Grader that that will be used by a program driver to enter in grades that a
student has earned and the prints out their final grade. In this particular scenario there are nine
(9) grades for a student throughout the course of the semester. These assignments are
1. HW 01
2. HW 02
3. Lab 01
4. Lab 02
5. Lab 03
6. Lab 04
7. Midterm 01
8. Midterm 02
9. Final Exam
When computing the final numerical grade, use the following weights • Homework - 10% • Labs
- 40% • Midterms - 25% • Final Exam - 25%. Once you have the numerical result for the student,
the Alphabetical grade can be computed using
A - total 90 B+ - 90 > total 85 B - 85 > total 80 C+ - 80 > total 75 C - 75 > total 70 D+ - 70 >
total 65 D - 65 > total 60 F - 60 > total
You have been supplied with a “Driver class” called TestGrader which creates an instance of a
Grader object and runs each method from the Grader class. The methods that you will need to
create are:
The default constructor Grader()- You should create class variables for each assignment, the
numerical total, and (for brevity) a scanner object for your grader class. Initialize all of the
numerical variables to zero (0), and create your Scanner object for user input.
A private method called checkRange that takes a double as an argument and checks to see if the
supplied double is within the acceptable range (0-100). If not, print “Invalid Grade” and exit.
Public “setter” methods (also known as modifiers) for the class variables corresponding to each
assignment (Ex. setHW01(), setLab02(), etc)
A method called calculateFinalGrade that calculates the final grade using the weights specified
above.
A method called printFinalGrade that prints the final alphabetical grade that corresponds to the
numerical total. A method called printGrades() that prints the assignment data
This is what is given by the \"Driver Class\"
/*
*
*/
import java.util.Scanner;
import java.util.InputMismatchException;
public class TestGrader {
public static void main (String[] args) {
Scanner scan = new Scanner(System.in);
Grader myGrader = new Grader();
while (true) {
prompt(myGrader);
try {
// Get the user\'s answer
int userinput = scan.nextInt();
// Catch the eol
scan.nextLine();
switch (userinput) {
case 1:
myGrader.setHW01();
myGrader.calculateFinalGrade();
break;
case 2:
myGrader.setHW02();
myGrader.calculateFinalGrade();
break;
case 3:
myGrader.setLab01();
myGrader.calculateFinalGrade();
break;
case 4:
myGrader.setLab02();
myGrader.calculateFinalGrade();
break;
case 5:
myGrader.setLab03();
myGrader.calculateFinalGrade();
break;
case 6:
myGrader.setLab04();
myGrader.calculateFinalGrade();
break;
case 7:
myGrader.setMidterm01();
myGrader.calculateFinalGrade();
break;
case 8:
myGrader.setMidterm02();
myGrader.calculateFinalGrade();
break;
case 9:
myGrader.setFinalExam();
myGrader.calculateFinalGrade();
break;
default:
System.exit(1);
}
} catch (Exception e) {
System.out.println(\"You did not enter a valid input. Exiting.\");
System.exit(1);
}.
This document discusses multiple selection (nested if-else statements) and switch statements in Java. It provides the syntax for multiple selection, an example of using nested if-else statements to check if a number is positive, negative, or zero, and an example grading scheme that uses multiple selection. Switch statements are also covered, including that break statements are typically used to transfer control out of each case and that missing break statements can cause control to fall through to subsequent cases.
This document provides an introduction to using the Google Test framework for unit testing C++ code. It begins with an example of a simple test for a function called calc_isect. It then demonstrates how to add assertions to tests, use test fixtures to reduce duplicated setup code, and generate parameterized tests. The document also covers best practices for test organization, installing and using Google Test, and some key features like XML output and selecting subsets of tests. Overall, the document serves as a tutorial for getting started with the Google Test framework for writing and running unit tests in C++ projects.
C programming uses basic elements like expressions, statements, blocks and functions. Expressions combine constants, variables and operators, while statements end with semicolons. A block of statements is treated as a single statement. Standard library functions include printf(), exit() and scanf(). Control structures like if-else, switch, for, while and do-while statements are used for decision making and looping.
This document provides an overview of key concepts in Java including Eclipse IDE, creating classes, the main method, printing output, variables, data types, user input, arithmetic operators, and typecasting. It explains how to create a Java class in Eclipse, use print statements, declare and initialize variables, take user input, and perform basic math operations and conversions between data types in Java.
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfaroraenterprisesmbd
All based on Zybooks = AP Java with zylabs
QUESTION 1
char[][] table = new char[10][5];
How many rows are in the array seen in the accompanying figure?
0
5
10
15
QUESTION 2
The standard output object in Java is ____.
output
System.out
Sys.out
System.in
QUESTION 3
The length of the string \"first java program\" is:
16
18
19
20
1 points
QUESTION 4
The loop condition of a while loop is reevaluated before every iteration of the loop.
True
False
1 points
QUESTION 5
If str1 is “Hello” and str2 is “Hi”, which of the following could not be a result of
str1.compareTo(str2);?
-9
-5
-1
1
1 points
QUESTION 6
Both System.out.println and System.out.print can be used to output a string on the standard
output device.
True
False
1 points
QUESTION 7
In a method call statement, when passing an array as an actual parameter, you use only its name.
True
False
1 points
QUESTION 8
Which of the following is true about a while loop?
The body of the loop is executed at least once.
The logical expression controlling the loop is evaluated before the loop is entered and after the
loop exists.
The body of the loop may not execute at all.
It is a post-test loop
1 points
QUESTION 9
int x, y;
if (x < 4)
y = 2;
else if (x > 4)
{
if (x > 7)
y = 4;
else
y = 6;
}
else
y = 8;
Based on the code above, what is the value of y if x = 9?
2
4
6
8
1 points
QUESTION 10
The array index can be any nonnegative integer less than the array size.
True
False
1 points
QUESTION 11
When a program executes, the first statement to execute is always the first statement in the main
method.
True
False
1 points
QUESTION 12
Java stores two-dimensional arrays in a row order form in computer memory.
True
False
1 points
QUESTION 13
The statement dataType[][][] arrayName; would declare a two-dimensional array.
True
False
1 points
QUESTION 14
All the methods defined in a class must have different names.
True
False
1 points
QUESTION 15
Which of the following is NOT a reserved word in Java?
double
throws
static
num
1 points
QUESTION 16
Given the declaration
int[] list = new int[50];
the statement
System.out.println(list[0] + \"...\" + list[49]);
outputs all 50 components of the array list.
True
False
1 points
QUESTION 17
In the case of an infinite while loop, the while expression (that is, the loop condition) is always
true.
True
False
1 points
QUESTION 18
Consider the following program.
public class CircleArea
{
static Scanner console = new Scanner(System.in);
static final double PI = 3.14;
public static void main(String[]args)
{
doubler;
double area;
r = console.nextDouble();
area = PI * r * r;
System.out.println(\"Area = \" + area);
}
}
To successfully compile this program, which of the following import statement is required?
import java.io.Scanner;
import java.util.Scanner;
import java.lang.Scanner;
No import statement is required
1 points
QUESTION 19
An identifier can be any sequence of characters and integers.
True
False
1 points
QUESTION 20
A single array can hold elements of many different data types.
Tr.
This document contains code examples demonstrating Java programming concepts like:
- Printing output to the console
- Declaring and initializing variables of different primitive data types
- Handling errors from incompatible type conversions
- Using loops and conditional statements like for and if
- Performing mathematical operations like square roots
- Taking user input using Scanner
- Concatenating Strings
- Declaring and initializing arrays
- Scope of variables declared within blocks
Internet and Web Technology (CLASS-16) [Basic Elements of Java Program] | NIC...Ayes Chinmay
The document discusses various concepts in Java programming including basic elements of Java programs, strings, date and time, switch statements, methods, recursion, polymorphism through method overloading and overriding, user input, and sample questions. It provides code examples to demonstrate strings, date/time, switch statements, methods, recursion, polymorphism, and user input. It also defines method overloading and overriding and compares the two.
The document contains a quiz on Java fundamentals with 29 multiple choice questions covering topics like classes, objects, variables, data types, and methods. It tests understanding of concepts like inheritance, abstraction, polymorphism, and exceptions. The questions have a single correct answer option to select from to test comprehension of Java language rules and behavior.
The document contains 17 Java code snippets that provide solutions to common programming problems and examples. Some of the problems addressed include: reversing an integer, checking if two words are anagrams, palindrome checking, merging two sorted arrays, left rotation of an array, sorting an array of 0s, 1s and 2s, counting character occurrences in a string, factorial, Fibonacci series, prime number checking, bubble sort, and substring searching. The code snippets provide full programs or methods to solve each problem in 1-5 steps or lines of code each.
The document describes 11 practical implementations of cryptographic techniques using C programming language. The techniques implemented include Caesar cipher, Playfair cipher, Hill cipher, Rail Fence cipher, Data Encryption Standard (DES), Rivest-Shamir-Adleman (RSA) algorithm, and Diffie-Hellman key exchange algorithm. For each practical, it provides the objective, description of the algorithm, example, steps of the algorithm, and the C program code with inputs and outputs. The document is a practical file submitted by a student to fulfill the requirements for a Bachelor of Technology degree.
Java Programming Below are the lexer token and shank file.pdfadinathassociates
Java Programming: Below are the lexer, token, and shank files with the shank.txt. Shank.java is
the main method file. The main goal is to make sure the shank.txt is being printed out in the
terminal of eclipse. Make sure there are no errors in the code at all. Show the screenshot of
shank.txt being read in the terminal. Attached is the rubric.
Lexer.java
package mypack;
import java.util.ArrayList;
import java.util.List;
import mypack.Token.TokenType;
import java .util.HashMap;
public class Lexer {
private static final int INTEGER_STATE = 1;
private static final int DECIMAL_STATE = 2;
private static final int IDENTIFIER_STATE = 3;
private static final int ERROR_STATE = 4;
private static final int SYMBOL_STATE = 5;
private static final int STRING_STATE = 6;
private static final int CHAR_STATE = 7;
private static final int COMMENT_STATE = 8;
private static final char EOF = (char) -1;
private static String input;
private static int index;
private static char currentChar;
private static int lineNumber = 1;
private static int indentLevel = 0;
private static int lastIndentLevel = 0;
private static HashMap<String, TokenType> keywords = new HashMap<String, TokenType>() {{
put("while", TokenType.WHILE);
put("if", TokenType.IF);
put("else", TokenType.ELSE);
put("print", TokenType.PRINT);
}};
private static HashMap<Character, TokenType> symbols = new HashMap<Character,
TokenType>() {{
put('+', TokenType.PLUS);
put('-', TokenType.MINUS);
put('*', TokenType.MULTIPLY);
put('/', TokenType.DIVIDE);
put('=', TokenType.EQUALS);
put(':', TokenType.COLON);
put(';', TokenType.SEMICOLON);
put('(', TokenType.LEFT_PAREN);
put(')', TokenType.RIGHT_PAREN);
put('{', TokenType.LEFT_BRACE);
put('}', TokenType.RIGHT_BRACE);
put('<', TokenType.LESS_THAN);
put('>', TokenType.GREATER_THAN);
}};
public Lexer(String input) {
Lexer.input = input;
index = 0;
currentChar = input.charAt(index);
}
private void nextChar() {
index++;
if (index >= input.length()) {
currentChar = EOF;
} else {
currentChar = input.charAt(index);
}
}
private void skipWhiteSpace() {
while (Character.isWhitespace(currentChar)) {
nextChar();
}
}
private int getIndentLevel() {
int level = 0;
int i = index;
char c = input.charAt(i);
while (c == ' ' || c == 't') {
if (c == 't') {
level += 1;
} else if (c == ' ') {
level += 1;
}
i++;
if (i >= input.length()) {
break;
}
c = input.charAt(i);
}
return level;
}
public List<Token> lex(String inputString) throws Exception {
input = inputString;
index = 0;
currentChar = input.charAt(index);
List<Token> tokens = new ArrayList<Token>();
while (currentChar != EOF) {
switch (currentState()) {
case INTEGER_STATE:
integerState(tokens);
break;
case DECIMAL_STATE:
decimalState(tokens);
break;
case IDENTIFIER_STATE:
identifierState(tokens);
break;
case ERROR_STATE:
errorState(tokens);
break;
case SYMBOL_STATE:
symbolState(tokens);
break;
case STRING_STATE:
stringState(tokens);
break;
case CHAR_STATE:
charState(tokens);
break;
case COMMENT_STATE:
commentState(tokens);
break;
def.
C++ Searching & Sorting5. Sort the following list using the select.pdfRahul04August
C++ Searching & Sorting
5. Sort the following list using the selection sort algorithm. Show the list after each iteration of
the outerforloop.
36, 55, 17, 35, 63, 85, 12, 48, 3, 66
6. Consider the following list: 5, 18, 21, 10, 55, 20
The first three keys are in order. To move 10 to its proper position using the insertion sort as
described in this chapter, exactly how many key comparisons are executed?
7. Consider the following list: 7, 28, 31, 40, 5, 20
The first four keys are in order. To move 5 to its proper position using the insertion sort as
described in this chapter, exactly how many key comparisons are executed?
8. Consider the following list: 28, 18, 21, 10, 25, 30, 12, 71, 32, 58, 15
This list is to be sorted using the insertion sort algorithm. Show the resulting list after six
passes of the sorting phase – that is, after six iterations of the for loop.
9. Perform the insertion sort algorithm using the following list of keys: 18, 8, 11, 9, 15, 20, 32,
61, 22, 48, 75, 83, 35, 3
Show the list after each iteration. Exactly how many key comparisons are executed to sort this
list using insertion sort?
10. a. The performance of bubble sort can be improved if we stop the sorting process as soon as
we find that in an iteration, no swapping of elements takes place. Write a function that
implements bubble sort algorithm using this fact.
b. Using the algorithm that you designed in part (a), find the number of iterations that are needed
to sort the list: 65, 14, 52, 43, 75, 25, 80, 90, 95.
11. Suppose that L is a sorted list of 4096 elements. What is the maximum number of
comparisons made by binary search to determine whether an item is in L?
12. Suppose that the elements of a list are in descending order, and they need to be put in
ascending order. Write a C++ function that takes as input an array of items in descending order
and the number of elements in the array. The function must not incorporate any sorting
algorithms, that is, no item comparisons should take place.
Solution
# include
# include
# include
#include
#include
#include
#include
// Function related to sorting in class sorting
class sorting
{
int array[50],array1[50],final[100],i,n,m,j;
public:
// Function to read an array
void read();
// Function to read arrays for merge sort
void read_mer();
// Function to display an array
void display();
// Function to perform bubble sort
void bub_sort();
// Function to perform selection sort
void Sel_sort();
// Function to perform insertion sort
void Ins_sort();
// Function to perform quick sort
void Qui_sort();
// Function to perform heap sort
void Heap_sort();
// Function to build a heap
void heap(int array[], int n);
// Function to interchange the value of root node with a
// child node in heap sort
void below_heap(int array[], int first, int last);
// Function to perform merges sort
void Mer_sort();
// Function to perform shell sort
void Shell_sort();
// Function to split the array into two halves during quick sort
void partition(int arra.
The program implements encryption and decryption of strings using the Blowfish algorithm. It generates a Blowfish secret key, uses it to initialize ciphers for encryption and decryption, and encrypts/decrypts a sample string. The encrypted string, decrypted string, and original string are printed for verification.
Similar to Encryption Decryption Java Project by Devansh Koolwal (20)
Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapte...University of Maribor
Slides from talk presenting:
Aleš Zamuda: Presentation of IEEE Slovenia CIS (Computational Intelligence Society) Chapter and Networking.
Presentation at IcETRAN 2024 session:
"Inter-Society Networking Panel GRSS/MTT-S/CIS
Panel Session: Promoting Connection and Cooperation"
IEEE Slovenia GRSS
IEEE Serbia and Montenegro MTT-S
IEEE Slovenia CIS
11TH INTERNATIONAL CONFERENCE ON ELECTRICAL, ELECTRONIC AND COMPUTING ENGINEERING
3-6 June 2024, Niš, Serbia
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELgerogepatton
As digital technology becomes more deeply embedded in power systems, protecting the communication
networks of Smart Grids (SG) has emerged as a critical concern. Distributed Network Protocol 3 (DNP3)
represents a multi-tiered application layer protocol extensively utilized in Supervisory Control and Data
Acquisition (SCADA)-based smart grids to facilitate real-time data gathering and control functionalities.
Robust Intrusion Detection Systems (IDS) are necessary for early threat detection and mitigation because
of the interconnection of these networks, which makes them vulnerable to a variety of cyberattacks. To
solve this issue, this paper develops a hybrid Deep Learning (DL) model specifically designed for intrusion
detection in smart grids. The proposed approach is a combination of the Convolutional Neural Network
(CNN) and the Long-Short-Term Memory algorithms (LSTM). We employed a recent intrusion detection
dataset (DNP3), which focuses on unauthorized commands and Denial of Service (DoS) cyberattacks, to
train and test our model. The results of our experiments show that our CNN-LSTM method is much better
at finding smart grid intrusions than other deep learning algorithms used for classification. In addition,
our proposed approach improves accuracy, precision, recall, and F1 score, achieving a high detection
accuracy rate of 99.50%.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Embedded machine learning-based road conditions and driving behavior monitoringIJECEIAES
Car accident rates have increased in recent years, resulting in losses in human lives, properties, and other financial costs. An embedded machine learning-based system is developed to address this critical issue. The system can monitor road conditions, detect driving patterns, and identify aggressive driving behaviors. The system is based on neural networks trained on a comprehensive dataset of driving events, driving styles, and road conditions. The system effectively detects potential risks and helps mitigate the frequency and impact of accidents. The primary goal is to ensure the safety of drivers and vehicles. Collecting data involved gathering information on three key road events: normal street and normal drive, speed bumps, circular yellow speed bumps, and three aggressive driving actions: sudden start, sudden stop, and sudden entry. The gathered data is processed and analyzed using a machine learning system designed for limited power and memory devices. The developed system resulted in 91.9% accuracy, 93.6% precision, and 92% recall. The achieved inference time on an Arduino Nano 33 BLE Sense with a 32-bit CPU running at 64 MHz is 34 ms and requires 2.6 kB peak RAM and 139.9 kB program flash memory, making it suitable for resource-constrained embedded systems.
TIME DIVISION MULTIPLEXING TECHNIQUE FOR COMMUNICATION SYSTEMHODECEDSIET
Time Division Multiplexing (TDM) is a method of transmitting multiple signals over a single communication channel by dividing the signal into many segments, each having a very short duration of time. These time slots are then allocated to different data streams, allowing multiple signals to share the same transmission medium efficiently. TDM is widely used in telecommunications and data communication systems.
### How TDM Works
1. **Time Slots Allocation**: The core principle of TDM is to assign distinct time slots to each signal. During each time slot, the respective signal is transmitted, and then the process repeats cyclically. For example, if there are four signals to be transmitted, the TDM cycle will divide time into four slots, each assigned to one signal.
2. **Synchronization**: Synchronization is crucial in TDM systems to ensure that the signals are correctly aligned with their respective time slots. Both the transmitter and receiver must be synchronized to avoid any overlap or loss of data. This synchronization is typically maintained by a clock signal that ensures time slots are accurately aligned.
3. **Frame Structure**: TDM data is organized into frames, where each frame consists of a set of time slots. Each frame is repeated at regular intervals, ensuring continuous transmission of data streams. The frame structure helps in managing the data streams and maintaining the synchronization between the transmitter and receiver.
4. **Multiplexer and Demultiplexer**: At the transmitting end, a multiplexer combines multiple input signals into a single composite signal by assigning each signal to a specific time slot. At the receiving end, a demultiplexer separates the composite signal back into individual signals based on their respective time slots.
### Types of TDM
1. **Synchronous TDM**: In synchronous TDM, time slots are pre-assigned to each signal, regardless of whether the signal has data to transmit or not. This can lead to inefficiencies if some time slots remain empty due to the absence of data.
2. **Asynchronous TDM (or Statistical TDM)**: Asynchronous TDM addresses the inefficiencies of synchronous TDM by allocating time slots dynamically based on the presence of data. Time slots are assigned only when there is data to transmit, which optimizes the use of the communication channel.
### Applications of TDM
- **Telecommunications**: TDM is extensively used in telecommunication systems, such as in T1 and E1 lines, where multiple telephone calls are transmitted over a single line by assigning each call to a specific time slot.
- **Digital Audio and Video Broadcasting**: TDM is used in broadcasting systems to transmit multiple audio or video streams over a single channel, ensuring efficient use of bandwidth.
- **Computer Networks**: TDM is used in network protocols and systems to manage the transmission of data from multiple sources over a single network medium.
### Advantages of TDM
- **Efficient Use of Bandwidth**: TDM all
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesChristina Lin
Traditionally, dealing with real-time data pipelines has involved significant overhead, even for straightforward tasks like data transformation or masking. However, in this talk, we’ll venture into the dynamic realm of WebAssembly (WASM) and discover how it can revolutionize the creation of stateless streaming pipelines within a Kafka (Redpanda) broker. These pipelines are adept at managing low-latency, high-data-volume scenarios.
A SYSTEMATIC RISK ASSESSMENT APPROACH FOR SECURING THE SMART IRRIGATION SYSTEMSIJNSA Journal
The smart irrigation system represents an innovative approach to optimize water usage in agricultural and landscaping practices. The integration of cutting-edge technologies, including sensors, actuators, and data analysis, empowers this system to provide accurate monitoring and control of irrigation processes by leveraging real-time environmental conditions. The main objective of a smart irrigation system is to optimize water efficiency, minimize expenses, and foster the adoption of sustainable water management methods. This paper conducts a systematic risk assessment by exploring the key components/assets and their functionalities in the smart irrigation system. The crucial role of sensors in gathering data on soil moisture, weather patterns, and plant well-being is emphasized in this system. These sensors enable intelligent decision-making in irrigation scheduling and water distribution, leading to enhanced water efficiency and sustainable water management practices. Actuators enable automated control of irrigation devices, ensuring precise and targeted water delivery to plants. Additionally, the paper addresses the potential threat and vulnerabilities associated with smart irrigation systems. It discusses limitations of the system, such as power constraints and computational capabilities, and calculates the potential security risks. The paper suggests possible risk treatment methods for effective secure system operation. In conclusion, the paper emphasizes the significant benefits of implementing smart irrigation systems, including improved water conservation, increased crop yield, and reduced environmental impact. Additionally, based on the security analysis conducted, the paper recommends the implementation of countermeasures and security approaches to address vulnerabilities and ensure the integrity and reliability of the system. By incorporating these measures, smart irrigation technology can revolutionize water management practices in agriculture, promoting sustainability, resource efficiency, and safeguarding against potential security threats.
Manufacturing Process of molasses based distillery ppt.pptx
Encryption Decryption Java Project by Devansh Koolwal
1. W E M A D E I T !
Akhil Yadav - ENG18CA0008
Devansh Koolwal - ENG18CA0014
BCA-2nd
JAVA PROJECT
Encryption Decryption
Dayananda Sagar University
2. T h r a s h . j a v a
package encryption.java;
public class thrash {
char[] alpha="ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray();
int[][] alphai={
{42,43,75,76,24,85,68,80,79,82,55,61,26,56,91,28,89,92,19,23,88,87,96,14,52,58},
{81,21,38,72,55,56,69,25,30,88,82,24,34,10,57,79,77,94,18,76,20,98,16,66,40,95},
{31,89,23,17,81,25,63,60,93,75,32,77,19,41,66,20,45,47,65,33,99,29,52,72,76,80},
{10,79,54,59,18,32,38,16,12,71,99,85,34,36,31,17,87,82,94,88,46,93,89,51,13,44},
{29,70,49,52,10,65,44,64,35,39,96,55,17,26,98,75,11,16,21,19,31,15,71,69,81,30},
{87,18,54,62,57,60,83,76,44,91,84,16,69,97,93,51,58,94,98,59,15,61,42,65,81,70},
{31,45,67,79,63,35,53,42,32,77,51,27,90,70,78,14,84,73,37,10,54,95,62,81,22,66}
};
//alphai represents 7 sets of character in numeric form
int [][] numri={
{42,43,75,76,24,85,68,80,79,82},
{81,21,38,72,55,56,69,25,30,88},
{31,89,23,17,81,25,63,60,93,75},
{10,79,54,59,16,31,38,16,12,71},
{29,70,39,52,10,65,64,64,35,39},
{87,18,58,60,51,60,83,76,44,92},
{34,45,67,79,63,37,53,42,34,77},
{78,37,77,12,91,91,36,87,15,52}};
//numri represents 7 sets of Numbers
4. M e s s a g e _ E n c r y p t I o n . j a v a
package encryption;
import javax.swing.JFrame;
import java.util.Random;
import javax.swing.JOptionPane;
public class Message_Encryption extends javax.swing.JFrame{
private void formWindowOpened(java.awt.event.WindowEvent evt) {
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
jLabel1.setHorizontalAlignment(jLabel1.CENTER);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
thrash th=new thrash();
String pre;
Random random=new Random();
String in=jTextPane2.getText();
char [] input=in.toCharArray();
for(int i=0;i<input.length;i++){
char temp=input[i];
10. ME S S A G E _ d e c r y p t I o n . j a v a
package encryption;
import javax.swing.JFrame;
import java.util.Random;
import javax.swing.JOptionPane;
public class Message_Decryption extends javax.swing.JFrame{
private void formWindowOpened(java.awt.event.WindowEvent evt) {
this.setExtendedState(JFrame.MAXIMIZED_BOTH);
this.setVisible(true);
jLabel1.setHorizontalAlignment(jLabel1.CENTER);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
thrash th=new thrash();
String pre;
String cod=jTextPane2.getText();
char[] code=cod.toCharArray();
int stringcase=-1;
int set=-1;
for(int i=0;i<code.length;){
for(int j=i;j<(i+9);j++){
for(int k=0;k<4;k++){
for(int h=0;h<5;h++){
if(code[j]==th.stringcase[k][h]) {
18. M a n u a l R e p r e s e n t a t I o n
• First it will check the case of char
1. Lower case = Print random character from stringcase of index [0][_]
2. Upper case = Print random character from stringcase of index [1][_]
3. Space = Print random character from stringcase of index [2][_]
4. Number = Print random character from stringcase of index [3][_]
• Then code will assign a random set of 0 to 7
• Print sign of set according to set index from sett[]
• Then it will select the index from alpha according to char
• Then using set and alpha index fetch sum from alphai or from numri
• Then code will divide sum into 6 parts and the sum of all 6 is equal to the no. fetched
by the code
• First 5 no. are under 9 and last no. can be between -99 to 99
• Then code will print first 5 numbers
• Then code will check condition of 6th
no.
1. If number is of 2 digit it will print “y” else “z”
2. If number is negative then code will print m else n
Example:
Algorithm Output
If char = ‘b’;
‘a’ is Lower case letter then code will print
any char from stringcase[0][_]
a
Random choose no 0-7 and print sett using chosen no.
as index
a!
Using Linear Search find out the index of char in alpha
From index and set fetch the value of sum from alphai
Random print 5 no. (0-9) a!58019
Then will find out the difference of sum of 5nos and the
sum fetched by the code from alphai
If no. is of 2 digit the print y else z a!58019z
If 6th
no. is negative then print m else n a!58019zm
If no. is negative then convert into positive and print a!58019zm2