I don't understand why I keep getting this error, How do I fix it?


you are defining an object which is not the member function of class Date.. Hence you should provide the object type as argument and then carryout member function operators in the function. You can't use d,y , m of the Date class in tjis function as it's not member function of Date,, Other way to do is declare operator++ as friend function of Date,but it also needs argument.
Given example
Date& operator++(Date &obj)
{
Date tmp;
int d,y,m;
d = obj.day();
y = obj.year();
m = obj.month();
++d;
if (is_date == false)
{
d = 1;
//if (m == dec)
if ( m == 12)
{
//assign 1 for
jan
m = 1;
++y;
}
else
{
//m = obj.Month(int(m) + 1);
obj.add_month(m
+ 1);
m =
obj.month();
}
}
tmp.add_day(d);
tmp.add_month(m);
tmp.add_year(y);
return tmp;
}
I don't understand why I keep getting this error, How do I fix it? In file...
I keep getting this error and I do not know how to fix
it. this is the code I've been working on:
please help me
import java.util.*;
public class TelephoneNumber {
public static void main(String[] args)
{String number;
int i=0,j=0;
char c;
Scanner in=new Scanner (System.in);
System.out.println("Enter the phone number: ");
number=in.nextLine();
number=number.toUpperCase();
c=number.charAt(i);
while(c!='\n'&&j<=7)
{switch(c)
{case 'A':
case 'B':
case 'C':
System.out.print("2");
j++;
break;
case 'D':
case 'E':
case 'F':
System.out.print("3");
j++;
break;
case 'G':
case 'H':
case'I':
System.out.print("4");...
The following code has a problem with polymorphism. I keep getting a runtime error. Error: "An unhandled exception of type System.InvalidCastException occured in polymorphism.exe" Apparently, I need one line of code to fix it. C# Code: class Sensor { private string sensorName; public Sensor(string _name) { sensorName = _name; } public virtual void ActionType() { Console.WriteLine("Sensor Detect Nothing."); } } class SmokeSensor : Sensor { private string type;...
Keep getting this error in my lab. Please help.
Here is my cpp file and the error given. Thank you
4 #include '10streat "Rationat . hi. .. Rational. cpp" 5 #include 6 :include Z using nanespace std 9 int sain) 11 char ch; 12 char op 13 Rational ri, r2, r3; 14 15 cout "nie lcome! I will evaluate expressions involving rational numbers for you 16 17 do 18 t 19 //Reading input 20 cout ee nEnter the expression (e.g.,...
Why am I getting this error? 3 errors found: File: /Users/FDM/Desktop/ITSC_1212_InitialSetup/ITSC_1212/bookClasses/Assignment3Part2.java [line: 57] Error: <identifier> expected File: /Users/FDM/Desktop/ITSC_1212_InitialSetup/ITSC_1212/bookClasses/Assignment3Part2.java [line: 57] Error: <identifier> expected File: /Users/FDM/Desktop/ITSC_1212_InitialSetup/ITSC_1212/bookClasses/Assignment3Part2.java [line: 59] Error: class, interface, or enum expected public class Assignment3Part2 { // public static void main(String [] args) throws InterruptedException { String filename; if (args.length > 0) { // got a filename passed into program as a parameter // don't change this part of the code needed by TA for grading filename = args[0];...
Why does Thevenin's Theorem work? I understand how to use it but I don't understand why it works. I have been reading my textbook and can follow the procedure, but I want to understand on a deeper level why the author does what they do. So far I know that the steps are 1. Find Vth, the open terminal voltage 2. Find isc, the short circuit current Vth 3. Rth isc But I don't know why these steps work. I...
What are the H30+ OH and pOH of the solution
I don't understand how I keep getting the wrong answers but the
right pH/pOH values
Be sure to answer all parts. what are [H3O+], [OHT, and pH in a solution with a pOH of 3.46? IH,x 10 OH 1- pH 10.5 x10 M
Please help, I don't
understand what I'm doing wrong because I keep getting .297uF but
it says it is wrong.
Find the total capacitance of the combination of capacitors shown in the figure below. (C1 = 33.4 μF, C2 = 4.28 μF. Enter your answer to three decimal places.) 297 which capacitances would you consider first? Review definition of series and parallel combinations. μF C1 C2 0.300 μF
CODE ERROR Please help to fix the error. I don't know why I can not output to file. when I open the output file there is an error. here is the input data: Princeton University NJ Princeton 41820 8014 0.0740 0.98 0.97 Harvard University MA Cambridge 43838 19882 0.0580 0.97 0.97 Yale University CT New Haven 45800 12109 0.0690 0.99 0.98 Columbia University NY New York 51008 23606 0.0690 0.99 0.96 Stanford University CA...
I have the attached code and keep getting an unexpected indent
error on the last line, how can I fix this?
1 import urllib 2 import re 3 url raw_input('Enter the URL:') 4 req request (url) 5 while True: 6 try: counts dict() fhandurllib.urlopen (req) for line in fhand: words line.split) for word in words: 10 counts[word] counts.get(word,0) 1 12 13 14 15 16 17 print(counts) data - count.getlength(512) if(len (data) < 1): break print data
"Function does not take 0 arguments". I keep getting this error for my last line of code: cout << "First Name: " << employee1.getfirstName() << endl; I do not understand why. I am trying to put the name "Mike" into the firstName string. Why is my constructor not working? In main it should be set to string firstName, string lastName, int salary. Yet nothing is being put into the string. #include<iostream> #include<string> using namespace std; class Employee { int...