This document contains 6 Java programs that demonstrate basic programming concepts like input/output, conditionals, loops, and functions. Program 1 takes input from the user and prints the sum. Program 2 prints numbers in a range. Program 3 finds the largest of 3 numbers. Program 4 checks if a number is prime. Program 5 prints the Fibonacci series up to 10 terms. Each program shows the code and expected output.
Code:
import java.util.Random;
import java.util.Scanner;
public class Test{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String bin = \"1\";
int n;
System.out.print(\"Enter the number of binary digits : \");
n = input.nextInt();
for(int i = 0; i < n-1; i++){
bin += randomBin();
}
System.out.println(bin);
}
public static String randomBin() {
Random rg = new Random();
int n = rg.nextInt(2);
return Integer.toBinaryString(n);
}
}
Output:
Enter the number of binary digits : 5
10110
Solution
Code:
import java.util.Random;
import java.util.Scanner;
public class Test{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String bin = \"1\";
int n;
System.out.print(\"Enter the number of binary digits : \");
n = input.nextInt();
for(int i = 0; i < n-1; i++){
bin += randomBin();
}
System.out.println(bin);
}
public static String randomBin() {
Random rg = new Random();
int n = rg.nextInt(2);
return Integer.toBinaryString(n);
}
}
Output:
Enter the number of binary digits : 5
10110.
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}
Solution
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}.
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}
Solution
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}.
Code:
import java.util.Random;
import java.util.Scanner;
public class Test{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String bin = \"1\";
int n;
System.out.print(\"Enter the number of binary digits : \");
n = input.nextInt();
for(int i = 0; i < n-1; i++){
bin += randomBin();
}
System.out.println(bin);
}
public static String randomBin() {
Random rg = new Random();
int n = rg.nextInt(2);
return Integer.toBinaryString(n);
}
}
Output:
Enter the number of binary digits : 5
10110
Solution
Code:
import java.util.Random;
import java.util.Scanner;
public class Test{
public static void main(String args[]){
Scanner input = new Scanner(System.in);
String bin = \"1\";
int n;
System.out.print(\"Enter the number of binary digits : \");
n = input.nextInt();
for(int i = 0; i < n-1; i++){
bin += randomBin();
}
System.out.println(bin);
}
public static String randomBin() {
Random rg = new Random();
int n = rg.nextInt(2);
return Integer.toBinaryString(n);
}
}
Output:
Enter the number of binary digits : 5
10110.
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}
Solution
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}.
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}
Solution
The sample program for above series in JAVA will be like below
import java.util.Scan;
public class PIVALUE {
public static void main(String[] args) {
// Scan object creation
Scan input = new Scan (System.in);
// ask user for input
System.out.println(\"Enter num.\");
double j = input.nextDouble(); // user entered value of j
double Tot = 0;
for(j=0; j<10000; j++){
if(j%2 == 0) // check remainder of `j/2` is 0
Tot += -1 / ( 2 * j - 1);
else
Tot += 1 / (2 * j - 1);
}
System.out.println(Tot);
}
}.
CODEimport java.util.; public class test { public static voi.pdfanurag1231
CODE:
import java.util.*;
public class test {
public static void main(String args[]) {
int num, sum=0;
Scanner input=new Scanner(System.in);
System.out.print(\"Input num : \");
num=input.nextInt();
while(num != 13) {
sum=sum+num;
System.out.print(\"Input num : \");
num=input.nextInt();
}
sum=sum+num;
System.out.println(\"Sum = \"+sum);
}
}
save the above file as test.java
Output:
javac test.java
java test
Input num :
1
Input num :
2
Input num :
3
Input num :
4
Input num :
5
Input num :
6
Input num :
7
Input num :
8
Input num :
9
Input num :
0
Input num :
13
Sum = 58
Solution
CODE:
import java.util.*;
public class test {
public static void main(String args[]) {
int num, sum=0;
Scanner input=new Scanner(System.in);
System.out.print(\"Input num : \");
num=input.nextInt();
while(num != 13) {
sum=sum+num;
System.out.print(\"Input num : \");
num=input.nextInt();
}
sum=sum+num;
System.out.println(\"Sum = \"+sum);
}
}
save the above file as test.java
Output:
javac test.java
java test
Input num :
1
Input num :
2
Input num :
3
Input num :
4
Input num :
5
Input num :
6
Input num :
7
Input num :
8
Input num :
9
Input num :
0
Input num :
13
Sum = 58.
import java.util.;public class Program{public static void.pdfoptokunal1
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println(x);
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Why does It print out the last set of X\'s twice? I am doing basic Java so please try to explain
using the most basic codes.
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println(x);
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Why does It print out the last set of X\'s twice? I am doing basic Java so please try to explain
using the most basic codes.
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println(x);
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Why does It print out the last set of X\'s twice? I am doing basic Java so please try to explain
using the most basic codes.
Solution
Hi,
I have modified the code. it is working as expected now. Highlighted the code changes below.
Issue here is with you have written this statement twice System.out.println(x); which causes the
issue.
Program.java
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println();
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Output:
Enter amount
10
Amount is: 10
X
XX
XXX
XXXX
XXXXX
XXXXXX
XXXXXXX
XXXXXXXX
XXXXXXXXX
XXXXXXXXXX.
Sample java programs for beginners. This slides can help you to print few words in java. Also it helps to do arithmetic calculations and will give you basic concept of for loop, do while loop and if else statements in java. Area of a square.
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfankkitextailes
SumNumbers.java
import java.util.Scanner;
public class SumNumbers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int sum = 0;
while(true){
System.out.println(\"Enter integer:\");
int n = scan.nextInt();
if(n == -1){
break;
}
sum = sum + n;
}
System.out.println(\"The sum is \"+sum);
}
}
Output:
Enter integer:
1
Enter integer:
2
Enter integer:
3
Enter integer:
4
Enter integer:
5
Enter integer:
6
Enter integer:
7
Enter integer:
8
Enter integer:
9
Enter integer:
-1
The sum is 45
Solution
SumNumbers.java
import java.util.Scanner;
public class SumNumbers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int sum = 0;
while(true){
System.out.println(\"Enter integer:\");
int n = scan.nextInt();
if(n == -1){
break;
}
sum = sum + n;
}
System.out.println(\"The sum is \"+sum);
}
}
Output:
Enter integer:
1
Enter integer:
2
Enter integer:
3
Enter integer:
4
Enter integer:
5
Enter integer:
6
Enter integer:
7
Enter integer:
8
Enter integer:
9
Enter integer:
-1
The sum is 45.
Codeimport java.util.; class Test{ public static void main(S.pdfanushasarees
Code:
import java.util.*;
class Test{
public static void main(String args[])throws Exception{
Scanner input = new Scanner(System.in);
System.out.print(\"Enter the First Number : \");
int n1=input.nextInt();
System.out.print(\"Enter the Second Number : \");
int n2=input.nextInt();
System.out.println(\"GCD : \"+gcd(n1,n2));
}
public static int gcd(int n1,int n2){
int r;
while(n2 != 0){
r = n1 % n2;
n1 = n2;
n2 = r;
}
return n1;
}
}
Output:
Enter the First Number : 54
Enter the Second Number : 24
GCD : 6
Solution
Code:
import java.util.*;
class Test{
public static void main(String args[])throws Exception{
Scanner input = new Scanner(System.in);
System.out.print(\"Enter the First Number : \");
int n1=input.nextInt();
System.out.print(\"Enter the Second Number : \");
int n2=input.nextInt();
System.out.println(\"GCD : \"+gcd(n1,n2));
}
public static int gcd(int n1,int n2){
int r;
while(n2 != 0){
r = n1 % n2;
n1 = n2;
n2 = r;
}
return n1;
}
}
Output:
Enter the First Number : 54
Enter the Second Number : 24
GCD : 6.
Factors.javaimport java.io.; import java.util.Scanner; class .pdfdeepakangel
Factors.java
import java.io.*;
import java.util.Scanner;
class Factors
{
public static void main(String args[])
{
int a,i;
Scanner in = new Scanner(System.in);
System.out.println(\"Enter an integer\");
a = in.nextInt();
System.out.println(\"You entered integer \"+a);
System.out.print(\"\ \");
System.out.print(\"The factors are : \");
for(i=1;i<=a/2;i++)
{
if(a%i==0)
System.out.print(i+\",\");
}
System.out.print(a);
}
}
Output:
Enter an integer
44
You entered integer 44
The factors are : 1,2,4,11,22,44
Solution
Factors.java
import java.io.*;
import java.util.Scanner;
class Factors
{
public static void main(String args[])
{
int a,i;
Scanner in = new Scanner(System.in);
System.out.println(\"Enter an integer\");
a = in.nextInt();
System.out.println(\"You entered integer \"+a);
System.out.print(\"\ \");
System.out.print(\"The factors are : \");
for(i=1;i<=a/2;i++)
{
if(a%i==0)
System.out.print(i+\",\");
}
System.out.print(a);
}
}
Output:
Enter an integer
44
You entered integer 44
The factors are : 1,2,4,11,22,44.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
CODEimport java.util.; public class test { public static voi.pdfanurag1231
CODE:
import java.util.*;
public class test {
public static void main(String args[]) {
int num, sum=0;
Scanner input=new Scanner(System.in);
System.out.print(\"Input num : \");
num=input.nextInt();
while(num != 13) {
sum=sum+num;
System.out.print(\"Input num : \");
num=input.nextInt();
}
sum=sum+num;
System.out.println(\"Sum = \"+sum);
}
}
save the above file as test.java
Output:
javac test.java
java test
Input num :
1
Input num :
2
Input num :
3
Input num :
4
Input num :
5
Input num :
6
Input num :
7
Input num :
8
Input num :
9
Input num :
0
Input num :
13
Sum = 58
Solution
CODE:
import java.util.*;
public class test {
public static void main(String args[]) {
int num, sum=0;
Scanner input=new Scanner(System.in);
System.out.print(\"Input num : \");
num=input.nextInt();
while(num != 13) {
sum=sum+num;
System.out.print(\"Input num : \");
num=input.nextInt();
}
sum=sum+num;
System.out.println(\"Sum = \"+sum);
}
}
save the above file as test.java
Output:
javac test.java
java test
Input num :
1
Input num :
2
Input num :
3
Input num :
4
Input num :
5
Input num :
6
Input num :
7
Input num :
8
Input num :
9
Input num :
0
Input num :
13
Sum = 58.
import java.util.;public class Program{public static void.pdfoptokunal1
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println(x);
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Why does It print out the last set of X\'s twice? I am doing basic Java so please try to explain
using the most basic codes.
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println(x);
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Why does It print out the last set of X\'s twice? I am doing basic Java so please try to explain
using the most basic codes.
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println(x);
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Why does It print out the last set of X\'s twice? I am doing basic Java so please try to explain
using the most basic codes.
Solution
Hi,
I have modified the code. it is working as expected now. Highlighted the code changes below.
Issue here is with you have written this statement twice System.out.println(x); which causes the
issue.
Program.java
import java.util.*;
public class Program
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String x=\"X\";
int amount;
System.out.println(\"Enter amount\");
amount=input.nextInt();
System.out.println(\"Amount is: \"+amount);
for(int i=1; i<=amount; i++)
{
System.out.println();
for(int j=1; j<=i; j++)
{
System.out.print(x);
}
}
}
}
Output:
Enter amount
10
Amount is: 10
X
XX
XXX
XXXX
XXXXX
XXXXXX
XXXXXXX
XXXXXXXX
XXXXXXXXX
XXXXXXXXXX.
Sample java programs for beginners. This slides can help you to print few words in java. Also it helps to do arithmetic calculations and will give you basic concept of for loop, do while loop and if else statements in java. Area of a square.
SumNumbers.java import java.util.Scanner;public class SumNumbe.pdfankkitextailes
SumNumbers.java
import java.util.Scanner;
public class SumNumbers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int sum = 0;
while(true){
System.out.println(\"Enter integer:\");
int n = scan.nextInt();
if(n == -1){
break;
}
sum = sum + n;
}
System.out.println(\"The sum is \"+sum);
}
}
Output:
Enter integer:
1
Enter integer:
2
Enter integer:
3
Enter integer:
4
Enter integer:
5
Enter integer:
6
Enter integer:
7
Enter integer:
8
Enter integer:
9
Enter integer:
-1
The sum is 45
Solution
SumNumbers.java
import java.util.Scanner;
public class SumNumbers {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
int sum = 0;
while(true){
System.out.println(\"Enter integer:\");
int n = scan.nextInt();
if(n == -1){
break;
}
sum = sum + n;
}
System.out.println(\"The sum is \"+sum);
}
}
Output:
Enter integer:
1
Enter integer:
2
Enter integer:
3
Enter integer:
4
Enter integer:
5
Enter integer:
6
Enter integer:
7
Enter integer:
8
Enter integer:
9
Enter integer:
-1
The sum is 45.
Codeimport java.util.; class Test{ public static void main(S.pdfanushasarees
Code:
import java.util.*;
class Test{
public static void main(String args[])throws Exception{
Scanner input = new Scanner(System.in);
System.out.print(\"Enter the First Number : \");
int n1=input.nextInt();
System.out.print(\"Enter the Second Number : \");
int n2=input.nextInt();
System.out.println(\"GCD : \"+gcd(n1,n2));
}
public static int gcd(int n1,int n2){
int r;
while(n2 != 0){
r = n1 % n2;
n1 = n2;
n2 = r;
}
return n1;
}
}
Output:
Enter the First Number : 54
Enter the Second Number : 24
GCD : 6
Solution
Code:
import java.util.*;
class Test{
public static void main(String args[])throws Exception{
Scanner input = new Scanner(System.in);
System.out.print(\"Enter the First Number : \");
int n1=input.nextInt();
System.out.print(\"Enter the Second Number : \");
int n2=input.nextInt();
System.out.println(\"GCD : \"+gcd(n1,n2));
}
public static int gcd(int n1,int n2){
int r;
while(n2 != 0){
r = n1 % n2;
n1 = n2;
n2 = r;
}
return n1;
}
}
Output:
Enter the First Number : 54
Enter the Second Number : 24
GCD : 6.
Factors.javaimport java.io.; import java.util.Scanner; class .pdfdeepakangel
Factors.java
import java.io.*;
import java.util.Scanner;
class Factors
{
public static void main(String args[])
{
int a,i;
Scanner in = new Scanner(System.in);
System.out.println(\"Enter an integer\");
a = in.nextInt();
System.out.println(\"You entered integer \"+a);
System.out.print(\"\ \");
System.out.print(\"The factors are : \");
for(i=1;i<=a/2;i++)
{
if(a%i==0)
System.out.print(i+\",\");
}
System.out.print(a);
}
}
Output:
Enter an integer
44
You entered integer 44
The factors are : 1,2,4,11,22,44
Solution
Factors.java
import java.io.*;
import java.util.Scanner;
class Factors
{
public static void main(String args[])
{
int a,i;
Scanner in = new Scanner(System.in);
System.out.println(\"Enter an integer\");
a = in.nextInt();
System.out.println(\"You entered integer \"+a);
System.out.print(\"\ \");
System.out.print(\"The factors are : \");
for(i=1;i<=a/2;i++)
{
if(a%i==0)
System.out.print(i+\",\");
}
System.out.print(a);
}
}
Output:
Enter an integer
44
You entered integer 44
The factors are : 1,2,4,11,22,44.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
CFD Simulation of By-pass Flow in a HRSG module by R&R Consult.pptxR&R Consult
CFD analysis is incredibly effective at solving mysteries and improving the performance of complex systems!
Here's a great example: At a large natural gas-fired power plant, where they use waste heat to generate steam and energy, they were puzzled that their boiler wasn't producing as much steam as expected.
R&R and Tetra Engineering Group Inc. were asked to solve the issue with reduced steam production.
An inspection had shown that a significant amount of hot flue gas was bypassing the boiler tubes, where the heat was supposed to be transferred.
R&R Consult conducted a CFD analysis, which revealed that 6.3% of the flue gas was bypassing the boiler tubes without transferring heat. The analysis also showed that the flue gas was instead being directed along the sides of the boiler and between the modules that were supposed to capture the heat. This was the cause of the reduced performance.
Based on our results, Tetra Engineering installed covering plates to reduce the bypass flow. This improved the boiler's performance and increased electricity production.
It is always satisfying when we can help solve complex challenges like this. Do your systems also need a check-up or optimization? Give us a call!
Work done in cooperation with James Malloy and David Moelling from Tetra Engineering.
More examples of our work https://www.r-r-consult.dk/en/cases-en/
Immunizing Image Classifiers Against Localized Adversary Attacksgerogepatton
This paper addresses the vulnerability of deep learning models, particularly convolutional neural networks
(CNN)s, to adversarial attacks and presents a proactive training technique designed to counter them. We
introduce a novel volumization algorithm, which transforms 2D images into 3D volumetric representations.
When combined with 3D convolution and deep curriculum learning optimization (CLO), itsignificantly improves
the immunity of models against localized universal attacks by up to 40%. We evaluate our proposed approach
using contemporary CNN architectures and the modified Canadian Institute for Advanced Research (CIFAR-10
and CIFAR-100) and ImageNet Large Scale Visual Recognition Challenge (ILSVRC12) datasets, showcasing
accuracy improvements over previous techniques. The results indicate that the combination of the volumetric
input and curriculum learning holds significant promise for mitigating adversarial attacks without necessitating
adversary training.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Water scarcity is the lack of fresh water resources to meet the standard water demand. There are two type of water scarcity. One is physical. The other is economic water scarcity.
1. JAVA
LAB 1
1:
CODE:-
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
int n1,n2;
Scanner op=new Scanner(System.in);
System.out.println("Enter No:");
n1 = op.nextInt();
n2 = op.nextInt();
System.out.println(" Sum of two no:"+(n1+n2));
}
}
2. OUTPUT:-
3:
CODE:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
int l,u;
Scanner op=new Scanner(System.in);
System.out.println("Enter lower limit and upper
limit :");
l = op.nextInt();
u = op.nextInt();
System.out.println("No. in increasing order:");
for(int i=l+1;i<=u-1;i++)
{
System.out.printf("%d ",i);
3. }
}
}
OUTPUT:-
CODE 4:
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner op=new Scanner(System.in);
int n1,n2,n3,lar=0;
System.out.println("Enter three numbers:");
n1 = op.nextInt();
n2 = op.nextInt();
n3 = op.nextInt();
if((n1<=100)&&(n2<=100)&&(n3<=100))