Hot answers tagged

1 vote

How to solve no suitable constructor found for Class1(Class2)?

This SE site is specifically for CS50 and its problems--according to the site/community rules, all questions should be related to CS50 courses and projects. You will have better success getting your ...
user avatar
1 vote
Accepted

How to solve incompatible types: Name cannot be converted to String in java?

Edit with the new info regarding the required UML specifications: As I wrote in a comment below (but am transferring here as an answer), your name variable is part of your Name class. This class has ...
user avatar
1 vote
Accepted

What does Random rand.nextInt(x)+y actually do?

What do you mean by "out of range"? int othernum = rand.nextInt(30) + 31; adding 31 to 30 and giving me numbers from 30 to 61 so is there something else to it because every time i run the ...
user avatar
  • 63.5k
1 vote

Why do I get a weird result when I am adding a number, string and then number again in java?

When you add an int to a String in Java, the int is implicitly cast to type String. So, you get addition in the first part because you are adding two ints. But, for the second part of the statement, ...
user avatar
1 vote

what is wrong with scanf in the program written bellow, Why it is not asking for value when input is not an integer?

Wow! Your program has a poisoned logic, I think what you want is to imitate the cs50.h library, however given the pset in which you find yourself is not easy. Let us begin: scanf requires you to ...
user avatar
  • 5,172

Only top scored, non community-wiki answers of a minimum length are eligible