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++:
»sample code: https://t.me/learntocodecpp/454
»sample code: https://t.me/learntocodecpp/457
The function
»sample : https://t.me/learntocodecpp/458
✅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/458
Travel agency managnment system by using oop PROJECT.cpp
15.7 KB
project one:<source AAU>
Q1.......is the standard markup language for creating webpages
Anonymous Quiz
12%
Python
7%
C++
78%
Html
4%
C#
the end tag for the HTML element <br> is:
Anonymous Quiz
52%
</br>
11%
</p>
21%
<br> itself
16%
none
Can you take a second to vote the poll to easy our notes and meets you well, which grade are you categorized in?
Anonymous Poll
8%
High school student
32%
Freshman student
63%
Bsc student
5%
Others
EvoNext
💻LESSON2🔖✍️ #Compiling a Program Compiling converts the source files that you write into bytecode that can be executed by a Java Virtual Machine. The source file has a #.java extension. It also defines a public class of the same name. For example, the class…
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
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);#Q1, From the statements given below, select the choice which assigns a value to X ?
Anonymous Poll
23%
X ++;
28%
Y = X;
26%
X == Y;
27%
None
👍5
EvoNext
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…
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.
» GROUP To cONTRIBUTE YOUR SKILL
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 SKILL
👍2
Q2: Which is the correct syntax to declare scanner class object?
Anonymous Poll
13%
Scanner objectName = Scanner():
23%
Scanner objectName =new Scanner():
13%
Scanner objectName = Scanner(System.in):
58%
Scanner objectName =new Scanner(System.in):
13%
NONE
OOP worksheet.pdf
30 KB
WORKSHEET FOR JAVA |LEARN TO CODE
https://t.me/PROGRAMINGLANGUAGES1
SHARE FOR MORE PROGRAMMING MATERIALS : thanks
https://t.me/PROGRAMINGLANGUAGES1
SHARE FOR MORE PROGRAMMING MATERIALS : thanks
EvoNext
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…
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).
https://t.me/PROGRAMINGLANGUAGES1»
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(a);
System.out.println(ab);
‼️THERE ARE ALOT OF METHODS IN JAVA FOR FURTHER MATHEMATICAL OPERATIONShttps://t.me/PROGRAMINGLANGUAGES1»
👍1