Sarah Singh

Greenhorn
+ Follow
since Jun 11, 2016
Merit badge: grant badges
Biography
I am a human, but I secretly aspire to be a Ninja \(^.^)/
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Sarah Singh

Hello there!

I am having issues testing my file:'( would be really grateful if someone can come through <3

*****************************************************************************************************
File
*****************************************************************************************************

***************************************************************************************************
This is the file I am trying to test^
***************************************************************************************************


*****************************JUnit****************************************************************


*************************************************************************************
I am trying to print the expected and the actual output ensuring that they're equal but I am not able to print any output on the console in Junit
***************************************************************************************
6 years ago
I have searched left and right and I have to do an assignment on critiquing this (title)! Does anyone have links to a poorly documented code? If you can provide me with such a link I'd be soo grateful to you!
Thanks
Regards
Sarah S
7 years ago
Hi, Can someone help me...


//I am unable to add the textfield on to my container..like it adds but it doesnt display...Can someone decipher as to why..Thanks! ^.^
8 years ago
I'd love to give this book a read Thanks!
8 years ago
Hello there ^.^

I have recently installed DevC++ 5.11 version on my Windows machine. Everytime I run my program I get an error saying, "redefinition of main" and opens a header file "conio.h" simultaneously. I have tried uninstalling and reinstalling the DevC++ several times. And everytime I reinstall, the DevC++ only works first few times before it starts giving me that error D:

I will be really thankful if anyone can point towards what is happening. Any help is greatly appreciated.

Thanks
Regards

8 years ago
@Norm
Yes it is!
Thank you \(^.^)/
8 years ago
@Norm The following is the code and I understand the question I asked now :P
The square brackets, meant array and hence the line hex[15] + hex[1] was referring to array index, hex[15] and hex[1] and the results were being added.
Thanks for looking into my problem \(^.^)/ Much Appreciated!

package Operators;


8 years ago
Thanks everyone who looked into my problem ^.^ And thanks for all the suggestions <3
This is really silly, but I realized thatsome of my print statements are wrong which is why I am not getting expected output D:
Sorry about that :'( Also, there was a bug in java.io.IOException Line which in now fixed \(^.^)/
Regards

Editted Code


8 years ago
@Jeanne Boyarsky

Gotchya! Thanks for clarifying that When I apply the edits,I think it goes into an infinite loop...since its not producing any output...unless I am doing something wrong :\



===========================================================================================
@Debdeep Ganguly

Yes! The code works with the suggested ammendment! Although I do not get the expected results

-------------------------------
Expected output

Help on:
1. if
2. switch
3. while
4. do-while
5. for
Choose one:
4
The do-while
do{
statement;
}while(condition);

--------------------------------------
Output after suggested ammendment

Help on:
if:
switch:
while:
do - while:
for
:
choose one:
8 years ago




I am trying to run this code but I am getting error in line "throw io.IOException;"(line 11) I have downloaded the TextIO file...I am not sure how to debug this,
Any help will be greatly appreciated ^.^
8 years ago

Thanks Jeane

Hi Norm,

public class HexByte {

public static void main(String[] args) {

char hex [] = {'0','1','2','3','4','5','6','7','8','9',
'a','b','c','d','e','f' };
byte b = (byte) 0xf1;

System.out.println("b = 0x" + hex[(b>>4) & 0x0f] + hex[b & 0x0f] );

}

}

I have worked out hex[(b>>4) & 0x0f] + hex[b & 0x0f] to be hex[15] + hex[1] but I have no idea how will hex[15] + hex[1] works out D:
8 years ago
Hi,
So I am currently trying to solve

hex[(b>>4) & 0x0f] + hex[b & 0x0f]

and I have worked it out until hex[15] + hex [1], But I dont know how to proceed from there...because, say the "hex" part wasnt there in the expression, wouldnt 15+1, considering they were decimals and we did not have to convert, be 16, which would be 0x10? D:

Then why does the console window give me an output of 0xf1..unless I am making a mistake in working it out...

Any help or contribution will be greatly appreciated. Thanks.