Questions tagged [operand]

177 questions
-2
votes
1 answer

Operator Overloading Error: no match for 'operator>>'

This is my header file. Im trying to overload the istream operator and use ifstream in my main function to read in a text file with structured data (rows and columns). I am getting the error "[Error] no match for 'operator>>' (operand types are…
user9206222
-2
votes
1 answer

Trying to make a point to point calculator. Unsupported operand types?

Im trying to make a program which calculates the distance between two user inputted points. How can I fix this so that it works? So far I have this import math p1 = [int(input("PLease enter point 1x\n")), (input("Please enter point 1y\n"))] p2…
-3
votes
1 answer

C2106: '=' : left operand must be l-value

So, I'm learning C as my first language and as doing some coding for practise I got the error above. I done everything as the book says (Stephen G. Kochan: Programming in C, Third Edition). What am I doing wrong? I'm using Microsoft Visual Studio…
-3
votes
1 answer

bad operand types for binary operator '+' for tostring return

Link to a screenshot of the code to the account class. I am trying to return the values in the toString but I do not know why this error occurs. I have tried to manually convert them into strings but to no avail. I am running out of…
-3
votes
2 answers

if an integer is equal to one of the integers in an array?

int[] usedArray = new int[25]; Random generator = new Random (); int randomNumber = generator.nextInt(2); System.out.println(randomNumber); if(randomNumber != usedArray){ app(); } while(randomNumber ==…
Leo Rickayzen
  • 43
  • 1
  • 2
  • 6
-4
votes
2 answers

Bad operand types

public double getRandKg(double[] value) { double min = 0.0; double max = 0.0; value * 0.90 = min; <------ this is where it says bad operand value * 1.10 = max; types for binary operator '*' Random r =…
-4
votes
1 answer

Python 3 k-mers count errors

I have to solve a problem (problem and the code is given below) and I'm getting errors on executing this program. Traceback (most recent call last): File "C:/Python33/exercise1.py", line 9, in for n in range[len(string) -…
evolvere
  • 101
  • 1
-5
votes
1 answer

adding an int to int in a list comprehension fails

in this statement stop_words_index = [word_index.get(w) + 3 for w in stop_words] word_index.get(w) is an int, but this statement generates TypeError: unsupported operand type(s) for +: 'NoneType' and 'int' How to fix this?
bhomass
  • 3,414
  • 8
  • 45
  • 75
-5
votes
2 answers

Operand error in temperature conversion in Java?

I am doing my first Java assignment and I'm struggling with an error here. * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the…
-5
votes
1 answer

>= Operand cannot be applied to types Bool and Float

I have this long if statement. Its giving me the error >= Operand cannot be applied to types Bool and Float if (tl.State == TouchLocationState.Pressed && (tl.Position.X >= harePlayer.Position.X >= tl.Position.X && tl.Position.Y >=…
Muffin
  • 33
  • 6
-6
votes
4 answers

Proper if..else syntax in Python

In my python code, I am attempting to implement an if..else statement. See below: if index[y] == index[x]: continue else index[y] != index[x] indexdn = indexd indadd= index[y]-index[x] …
Brandon Ginley
  • 249
  • 3
  • 12
-6
votes
1 answer

unsupported operand type(s) for -: 'str' and 'str' - Getting this error and I have no idea why

Currently creating a Cesears Cipher, in particular the decryption. for char in decryptString: x = ord(char) x = x - decryptVal #this is my negative shift if x < 32: x = x + 32 elif x > 126: x = x - 95 result =…
1 2 3
11
12