Tony
Great! Right track then.
Tony
Another victim student of C++!
Anonymous
Hi
Anonymous
Lottery Pv
Azrul
Guys
Azrul
Can you guys help me with java?
Anonymous
Pv
Azrul
Can you guys help me with java?
package lab; import java.util.Scanner; public class Employee { Scanner Set= new Scanner(System.in); private String name, workerId, department; private Float workingHours, payrate; //calculate the salary public void calculateSalary() { System.out.println("enter your total work hour"); float workingHours= Set.nextFloat(); payrate= workingHours * 25; System.out.println("enter your total work hour"); } public void displaydetails() { System.out.println("your name is:"+ name); System.out.println("your worker Id is:"+ workerId); System.out.println("your department is:"+ department); System.out.println("your salary is: RM"+ payrate); } public void setDetails() { System.out.println("enter your name:"); String name = Set.next(); System.out.println("enter your worker ID:"); String workerId = Set.next(); } public static void main(String[] args) { // TODO Auto-generated method stub Employee employee = new Employee(); employee.setDetails(); employee.calculateSalary(); employee.displaydetails(); } }
Azrul
public void setDetails() { System.out.println("enter your name:"); String name = Set.next(); System.out.println("enter your worker ID:"); String workerId = Set.next(); }
Azrul
this part they said the value of the local variable name is not used meaning
Azrul
help me guys
Azrul
🥺
Anonymous
Pv
Azrul
Pv
what is pv?
Azrul
Anonymous
Igor🇺🇦
Can you guys help me with java?
There are Java groups on Telegram. This is for C/C++
Anonymous
Pv
Anonymous
Size of int is 2 or 4 bytes, low order byte is the least significant byte. Consider a number like 0xABCD the least significant byte would be 0xCD in this case
As in pic u can see it's return type is int and function argument is also int , so char is converted to int right , so here what's use of that least significant byte
Anonymous
No data is lost as conversion is to int ...
If it's in main(), yes.
It's in an if condition In a for loop in main() and there are codes after the for loop
MilkBeforeCereal
cancer
NXiss7
Register is 2x+ faster that anything else
Registers are damn fasters but compiler usually knows better than you which var should be kept int registers. You usually just slow things down or just get ignored...
Yakov
That must be messy... 😂😂
Hey, where are u from?
Tony
>Username literally just being your phone number
Tony
Could you be any sadder?
András
>Username literally just being your phone number
It's not phone number. 1 symbol is missing for that
Tony
It's a US phone number. (+)1(902)...
András
Is size of name exactly as size of US phone number?
Pavel
No data is lost as conversion is to int ...
No data will be lost if you pass a char (that will be converted to int). But as the comment says, if you try to pass an int greater than capacity of char, then only the least significant part of it will be taken into account. So there will be a data loss in this case.
NXiss7
Hey, where are u from?
Why'd you ask? 😅
Yakov
Why'd you ask? 😅
You helped me few days ago and I’m just curious.
NXiss7
In most cases yes
I saw a guy on SO asking why his asm is slower than compiled C code. He was using 64 bit div instruction to divide by two 😂😂😂😂😂
Anonymous
Pv
Nameful
Pv
/report been PM'd by one of these before, they send you some casino link or whatever
Anonymous
I'm nt good at coding on my own... How to do it on my own? Any suggestions?
Anonymous
Am sory 😞
Anonymous
And practice!
Nameful
Keep writing code and you'll figure it out eventually
Anonymous
It comes with time
I know but how? I'm somewhat good at python
Nameful
I know but how? I'm somewhat good at python
What do you struggle with in C/C++?
Nameful
/report
Sergio Marquina
/information
Tariq
https://www.instagram.com/p/B6FNE0KBZi6/?igshid=m51ktd6nsn6w
M0N60053
waats wrong with my code its not desplaying anything after i compile
Hubert
look at the red point
MilkBeforeCereal
...
waats wrong with my code its not desplaying anything after i compile
please...... int get_max(int a, int b) { return a > b ? a : b; }
MilkBeforeCereal
waats wrong with my code its not desplaying anything after i compile
you need to clean up the way you write it a bit tho
MilkBeforeCereal
https://del.dog/inivofumel.cpp something like so
NXiss7
I'm nt good at coding on my own... How to do it on my own? Any suggestions?
Create a project by yourself... Struggle till you get it done.
M0N60053
look at the red point
😂😂thanks didn't see it
NXiss7
😂😂thanks didn't see it
End line after printing value
NXiss7
cout << getMax(4, 6) << endl;
Anonymous
Given a linked list, remove the n-th node from the end of list and return its head.
Anonymous
Someone could help me?
Anonymous
In c
klimi
In c
LANG=C What is your issue?
Anonymous
I can t resolve it it s a leetcode problems
klimi
I can t resolve it it s a leetcode problems
well we wond do it for you but you may ask here your doubts if you have tried solving it with all you got and still you dont know
Anonymous
Dima
/warn read the rules
Anonymous
It my code what i ve wrong?
Anonymous
pastebin.com
But to be honest for small snippets it should be allowed to post clean screenshots. Its often just easier to have a quick look. At least thats my opinion
Anonymous
Alright thats fine 👍