نصائح و استشارات برمجية
1.45K subscribers
546 photos
10 videos
83 files
398 links
• نصائح واستشارات برمجية متعلقة باسئلة تم طرحها

• لطرح استفسار او سؤال: @m4md24
Download Telegram
نصائح و استشارات برمجية
#include <iostream> using namespace std; enum enweekday { sun = 1, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 }; void showweekday() { cout << "*************************" << endl; cout << "* week day meue *" << endl; cout << "****…
دا التصحيح ↓

#include <iostream>
using namespace std;

enum enweekday { sun = 1, mon = 2, tue = 3, wed = 4, thu = 5, fri = 6, sat = 7 };

void showweekday()
{
cout << "*************************" << endl;
cout << "* week day menu *" << endl;
cout << "*************************" << endl;
cout << "(1) sunday." << endl;
cout << "(2) monday." << endl;
cout << "(3) tuesday." << endl;
cout << "(4) wednesday." << endl;
cout << "(5) thursday." << endl;
cout << "(6) friday." << endl;
cout << "(7) saturday." << endl;
cout << "*************************" << endl;
cout << "please enter the number of day ?" << endl;
}

enweekday readweekday()
{
int wd;
cin >> wd;
return static_cast<enweekday>(wd);
}

string getweekdayname(enweekday weekday)
{
switch (weekday)
{
case sun:
return "sunday";
case mon:
return "monday";
case tue:
return "tuesday";
case wed:
return "wednesday";
case thu:
return "thusday";
case fri:
return "friday";
case sat:
return "saturday";
default:
return "wrong day";
}
}

int main()
{
showweekday();

cout << "today is " << getweekdayname(readweekday()) << endl;

return 0;
}
This media is not supported in your browser
VIEW IN TELEGRAM
الكود دا صح؟

x=int(input("Enter 1st number:"))
y=int(input("Enter 2nd number:"))
z=float(input("Enter 3rd number:"))
n1=x+y+z
n2=n1/3
n3=x*y*z
n4=x-y-z
n5=x%y%z
print n1
print n2
print n3
print n4
print n4
نصائح و استشارات برمجية
الكود دا صح؟ x=int(input("Enter 1st number:")) y=int(input("Enter 2nd number:")) z=float(input("Enter 3rd number:")) n1=x+y+z n2=n1/3 n3=x*y*z n4=x-y-z n5=x%y%z print n1 print n2 print n3 print n4 print n4
• غلطانه في امر الطباعة، دا التصحيح ↓
x = int(input("Enter 1st number:"))
y = int(input("Enter 2nd number:"))
z = float(input("Enter 3rd number:"))
n1 = x + y + z
n2 = n1 / 3
n3 = x * y * z
n4 = x - y - z
n5 = x % y % z
print(n1)
print(n2)
print(n3)
print(n4)
print(n5)
This media is not supported in your browser
VIEW IN TELEGRAM
لتعلم سي شارب
خصوصا موضوع stack
وهي امور متقدمة
نصائح و استشارات برمجية
وهي امور متقدمة
• كله باذن الرحمن باليوتيوب او اي منصة دورات تعليمية

• وبالنسبة لدورات السي شارب شوف الموقع دا ⬇️:
m3md69.github.io/NULLEXIA

فيه دورات تعليمية لناس بتعرف تشرح .. كل اللي عليك انك تروح لقسم التعلم و تختار اللي عايزه .. الناس اللي بتشرح مختارهم بنفسي

• و كمان في كتب متقدمة هتفيدك ان شاء الله ⬇️
This media is not supported in your browser
VIEW IN TELEGRAM
شباب يعطيكم العافيه
لو ما حطيت إشارة { } لل else هون بصير اشي
يعني لو في else If أكثر من وحدة لازم احطها لو لوب ...
نصائح و استشارات برمجية
يعني لو في else If أكثر من وحدة لازم احطها لو لوب ...
• يا غالي، لو مثلا امر واحد عادي لو متحطش اقواس، زي كدا ⬇️
if (1 <= 4) cout << "Done";
• اما لو اكتر من امر فا لازم تحط اقواس، زي كدا ⬇️
if(1 <= 4) {
cout << "Done1";
cout << "Done2";
}

• مش شرط تعمل دا لل if بس، هو في الاصل ينفع لاي موضوع اخر زي for و while و غيرهم
This media is not supported in your browser
VIEW IN TELEGRAM
Here are the solutions to your questions:

1. Program in Java to display the value of a number before and after post-increment:

public class PostIncrementExample {
public static void main(String[] args) {
int num = 5;
System.out.println("Original value of num: " + num);
System.out.println("Value of num after post-increment: " + (num++));
System.out.println("Value of num after post-increment: " + num);
}
}
2. Program in Java to multiply a number by 3 using the result operator and display the result:

public class ResultOperatorExample {
public static void main(String[] args) {
int num = 4;
num *= 3; // This is equivalent to: num = num * 3
System.out.println("Result of multiplying the number by 3: " + num);
}
}
3. Program in Java to use the Math functions to round a user-given decimal number to the nearest whole number:

import java.util.Scanner;

public class RoundToNearestWholeNumber {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter a decimal number: ");
double decimalNumber = scanner.nextDouble();
long roundedNumber = Math.round(decimalNumber);
System.out.println("Rounded number to the nearest whole number: " + roundedNumber);
}
}
Please try running these programs and let me know if you have any further questions or need any additional assistance!