EvoNext
الذهاب إلى القناة على Telegram
Hi, I’m Biruk! Software Engineer bridging the gap between Full-Stack Development (Frontend & Backend), Server Environments, Computer Networks, and AI-driven Digital Art. Beyond Telegram, I love sharing my technical insights & build updates.
إظهار المزيد1 619
المشتركون
-224 ساعات
-117 أيام
-4430 أيام
أرشيف المشاركات
1 619
LESSON 5:
JAVA MATH:
⚜️The Java Math class has many methods that allows you to perform mathematical tasks on numbers.
✳️The Math.sqrt(x) method returns the square root of x.
✳️The Math.max(x,y) method can be used to find the highest value of x and y.
✳️ The Math.abs(x) method returns the absolute (positive) value of x.
❤️ Math.random() returns a random number between 0.0 (inclusive), and 1.0 (exclusive).
public class Firsta {
public static void main(String[] args) {
double x,y,z;
/*double x = 3.14;
double y = 3.41;
double z = Math.max(x, y);
double a = Math.sqrt(5);
double ab = Math.ceil(x);// maximum number
double ac = Math.floor(y);// minimum number
System.out.println(z);*/
System.out.println(z);
System.out.println(z);
1 619
LESSON 5:
JAVA MATH
public class Firsta {
public static void main(String[] args) {
double x,y,z;
/*double x = 3.14;
double y = 3.41;
double z = Math.max(x, y);
double a = Math.sqrt(5);
double ab = Math.ceil(x);
double ac = Math.floor(y);
System.out.println(z);*/
1 619
WORKSHEET FOR JAVA |LEARN TO CODE
https://t.me/PROGRAMINGLANGUAGES1
SHARE FOR MORE PROGRAMMING MATERIALS : thanks
1 619
LESSON 4:
IMPORTING SCANNER CLASS IN | JAVA
👨🏽💻Scanner is a class in java.util package used for obtaining the input of the primitive types like int, double, etc. and strings.
✳️To read numerical values of a certain data type XYZ, the function to use is nextXYZ().
✅ To read strings, we use nextLine().
🔱To read a single character, we use next().charAt(0). next() function returns the next token/word in the input as a string and charAt(0) function returns the first character in that string.
import java.util.Scanner;
public class Firsta {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("enter some String");
String name = scanner.nextLine();
System.out.println("enter your age");
int x = scanner.nextInt();
scanner.nextLine();
System.out.println("what is you departent? ");
String dep =scanner.nextLine();
System.out.println("your name is: "+name);
System.out.println("your age is:"+ x);
System.out.println("your in "+dep+" departement now!");
}
}
» share and join this channel and
» GROUP To cONTRIBUTE YOUR SKILL1 619
#Q1, From the statements given below, select the choice which assigns a value to X ?
1 619
LESSON 3
ASSIGNMENT
✅> Every variables is assigned data type that designates the type and quantity of value it can hold.
✳️<> as many of you guess , variable is a name given to a memory location.
⚜️During declaration of a variable, we nedd to take care of two things
1. Dataype
2. Dataname
Similarly , we can initialize variables by assigning values in two ways:
1.variable initialization//
2. Assigning value by taking input from user//
/look the snippet code below with different dataypes and initializations
public class Firsta {
public static void main(String[] args) {
long x = 2345267;
float y =3.45f;
boolean z = true;
char ch = '@';
String str ="learn to code!!";
System.out.println("the number is: " +x);
System.out.println(y);
System.out.println(z);
System.out.println(ch);
System.out.println(str);1 619
Can you take a second to vote the poll to easy our notes and meets you well, which grade are you categorized in?
1 619
Error handling during file operations in C/C++
✅It is quite common that errors may occur while reading data from a file in C++ or writing data to a file.
Below are some Error handling functions during file operations in C/C++:
ferror():
❤️The ferror() function checks for any error in the stream. It returns a value zero if no error has occurred and a non-zero value if there is an error.
»sample code: https://t.me/learntocodecpp/454
clearerr():
🖤The function clearerr() is used to clear the end-of-file and error indicators for the stream.
»sample code: https://t.me/learntocodecpp/457
The function perror()
🤍stands for print error. In case of an error, the programmer can determine the type of error that has occurred using the perror() function.
»sample : https://t.me/learntocodecpp/4581 619
Error handling during file operations in C/C++
✅It is quite common that errors may occur while reading data from a file in C++ or writing data to a file.
Below are some Error handling functions during file operations in C/C++:
ferror():
❤️The ferror() function checks for any error in the stream. It returns a value zero if no error has occurred and a non-zero value if there is an error.
»sample code: https://t.me/learntocodecpp/454
1 619
Error handling during file operations in C/C++
🛑It is quite common that errors may occur while reading data from a file in C++ or writing data to a file.
Below are some Error handling functions during file operations in C/C++:
ferror():
🖤checks for any error in the stream. It returns a value zero if no error has occurred and a non-zero value if there is an error.
clearerr():
🤍is used to clear the end-of-file and error indicators for the stream.
perror():
❤️stands for print error. In case of an error, the programmer can determine the type of error that has occurred using the perror() function.
