Closed Sanitya7 closed 1 year ago
@Vikash-8090-Yadav This is for Level 0 , A folder for All the If-Else Program based on Solidity for the learners. Let me know other program which we can build for If-Else in basic domain.
I will be also adding swapping and leap year program soon π
Add @Sanitya7 min 10 code as i am assigning u this as Intermediate level . Thank u
Hi, I have updated, check it out Thanks π
min 10 code means u have to add atleast 10 code file to get intermediate label . Hope u understand :smile:
πAlright, I got it wrong.
On Tue, Aug 16, 2022, 12:36 AM Vikash Yadav @.***> wrote:
min 10 code means u have to add atleast 10 code file to get intermediate label . Hope u understand π
β Reply to this email directly, view it on GitHub https://github.com/Vikash-8090-Yadav/Solidity-Pathshala/issues/39#issuecomment-1215621909, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVOREEJORT4DD3WITEX72MDVZKINFANCNFSM56ECYTTA . You are receiving this because you were assigned.Message ID: @.***>
Hi @Vikash-8090-Yadav , I have added some codes in this file π
@Sanitya7 ya its corrrect raise a p.r for this and made the Readme also .
π
if u are taking part in hackatoberfest . open this issue and ping me . @Sanitya7
Hi, Yes I am taking part in Hackatoberfest, this time I missed to contribute at my best full potential due to health issues, but now I'm back, back with a bang !
On Fri, Sep 30, 2022 at 11:54 PM Vikash Yadav @.***> wrote:
if u are taking part in hackatoberfest . open this issue and ping me . @Sanitya7 https://github.com/Sanitya7
β Reply to this email directly, view it on GitHub https://github.com/Vikash-8090-Yadav/Solidity-Pathshala/issues/39#issuecomment-1263884432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVOREEMSGQVCLYLA4UK2P7TWA4V4TANCNFSM56ECYTTA . You are receiving this because you were mentioned.Message ID: @.***>
@Vikash-8090-Yadav Let us open it back and build Solidity Pathshala.
ya sure @Sanitya7
Thanks @Vikash-8090-Yadav sir , Hackatober will be a good time to learn more
Yup @Sanitya7 . now start working on this , sorry for the late reply :cry:
@Vikash-8090-Yadav What needs to be done for this issue? I am up for the task.
Hi @Antibodyy π You may add more if-else codes in the file, We will be raising a PR, by 3rd October. Also, you may update the readme files for the same.
@Vikash-8090-Yadav You may check this, This is done almost, only readme are left, we can raise a PR for this.
hello @Sanitya7 , I read your above messages I can add a few more if-else block programs if required, Should I?
@Abhishek-Kumar-Sharma69 no u can't as i am not accepting the basics codes right now.u can look into level1 folder.
Hey @Sanitya7 are u stil working on this ?
Hi, This is done, only I have to raise PR for this. I was waiting for SWOC to raise it
Gr8 :smile:
Hi @Vikash-8090-Yadav , I have raised a PR for the same, you may check it. Loved building this
Project title
If-Else Programs
Project Description
This file consists of basic program constructed by using conditional statements
contract check_even { function even_odd( uint _num) public pure returns ( int ) { if ( _num % 2 == 0 ){ return 1; } else { return 0; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract greattwoCheck { function checkBig( uint _x, uint _y) public pure returns ( uint ) { if ( _x > _y ){ return _x; } else if ( _x == _y ){ return 0; } else { return _y; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract getMIN { function get_min( uint _x, uint _y) public pure returns ( uint ) { if ( _x > _y ) { return _y; } else if ( _x < _y ) { return _x; } else { return 0; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract whichQuadrant { function quad( int _x, int _y) public pure returns ( int ) { if ( _x > 0 ){ if ( _y > 0 ){ return 1; } else { return 4; } } if ( _x < 0 ){ if ( _y > 0 ){ return 3; } else { return 2; } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract moreThan10 { function getNum( int _num) public pure returns ( int ) { if ( _num > 10 ){ return 1 ; } else { return 0; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract VotingAgeLimit{ uint public Age ; bool public Valid ; //function for checking the age function Check_Age_Limit( uint _x ) public payable returns( bool ){ Age = _x ; if (Age >= 18){ Valid = true ; return Valid; } else { Valid = false ; return Valid ; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract ScoreCard{ uint public percentage ; string public grade ; //Function for checking the grade at the percentage function giveGrades( uint _percent ) public payable returns( string memory ){ string memory gradeA = 'A'; string memory gradeB = 'B'; string memory gradeC = 'C'; string memory gradeD = 'D'; string memory gradeE = 'E'; percentage = _percent ; if (percentage >= 90 ){ grade = gradeA ; return grade ; } else if ( percentage >= 80 ){ grade = gradeB; return grade ; } else if ( percentage >= 70 ){ grade = gradeC ; return grade ; } else if ( percentage >= 60 ){ grade = gradeD; return grade ; } else { grade = gradeE ; return grade ; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract GiveTimeBonus{ uint public time ; string public Bonus ; //Function for time worked by Employee function GetTime( uint _yearsWorked ) public { time = _yearsWorked; } //Function for Deciding Bonus //Basic salary for worker -> 10,000 function DecideBonus() public payable returns( string memory ){ string memory percent10 = "10%"; string memory percent5 = "5%"; string memory percent8 = "8%"; if ( time > 10 ){ Bonus = percent10 ; return Bonus ; } else if ( time < 6 ){ Bonus = percent5 ; return Bonus ; } else if ( time > 6 ){ if ( time < 10 ){ Bonus = percent8 ; return Bonus ; } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract DiscountedPrice{ uint public markedPrice ; string public Discount ; //Function for getting the marked price of the good function getMarkedPrice( uint _price ) public { markedPrice = _price ; } //Function for deciding the Discount function decideDiscount( ) public payable returns( string memory ){ string memory dis20 = "20%"; string memory dis10 = "10%"; string memory dis5 = "5%"; if (markedPrice > 10000) { Discount = dis20 ; return Discount ; } else if ( markedPrice < 5000 ){ Discount = dis5 ; return Discount ; } else if ( markedPrice > 5000 ){ if ( markedPrice < 10000 ){ Discount = dis10 ; return Discount ; } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract CheckTriangle{ uint public sideA ; uint public sideB ; uint public sideC ; //Function for getting the sides by User function getsideA( uint _a ) public { sideA = _a ; }
}
// SPDX-License-Identifier: MIT pragma solidity 0.8.0;
contract WhichDay{ uint public DayNum ; string public Day ; //Function for getting thr day number by user function getnum( uint _x) public { DayNum = _x ; } //Function for getting day function getDay() public payable returns( string memory){ string memory day1 = "Monday"; string memory day2 = "Tuesday"; string memory day3 = "Wednesday"; string memory day4 = "Thursday"; string memory day5 = "Friday"; string memory day6 = "Saturday"; string memory day7 = "Sunday"; if ( DayNum == 1 ){ Day = day1 ; return Day ; } else if ( DayNum == 2){ Day = day2 ; return Day ; } else if ( DayNum == 3 ){ Day = day3 ; return Day ; } else if ( DayNum == 4 ) { Day = day4 ; return Day ; } else if ( DayNum == 5 ) { Day = day5 ; return Day ; } else if ( DayNum == 6 ) { Day = day6 ; return Day ; } else if ( DayNum == 7 ) { Day = day7 ; return Day ; } else { Day = "Not Valid"; return Day ; } } }