F&A Diskussionen
need help plz
0 Stimmen
2 AntwortenWY I get a rundum number from memory when I run this code
#include <iostream>
using namespace std;
int main ()
{
int array [5];
for (int x = 0; x < 5; x++) {
array [x] = 42;
cout << x << ': ' << array [x] << endl;
}
return 0;
}
if I replace ': ' with ": " every thing works well.
0 Stimmen
2 Antwortenexplanation plzzzz!!!
0 Stimmen
2 Antwortenпомогите с заданием
1 Stimme
1 Antwortcan anyone plz explain me this program step by step?#include <iostream>
using namespace std;
class MyClass {
public:
int var;
MyClass() { }
MyClass(int a)
: var(a) { }
MyClass operator+(MyClass &obj) {
MyClass res;
res.var= this->var+obj.var;
return res;
}
};
int main() {
MyClass obj1(12), obj2(55);
MyClass res = obj1+obj2;
cout << res.var;
}I am not getting the part inside operator+
0 Stimmen
8 Antwortenhey guys, I've been trying to work out the formula 'v=I*r'. But whenever I run the program and input values for I and r, it doesn't give the right answer.
This is the code
#include <iostream>
using namespace std;
int main() {
int i,r;
int v = i*r;
cout<<"what is the value of i?\n";
cin>>i;
cout<<"what is the value of r?\n";
cin>>r;
cout<<"voltage ="<<v<<endl;
return 0;
}
p/s: I'm new to programming
1 Stimme
8 Antwortenusing System;
namespace GoodProgrammerTest
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter Yes or No");
Console.Write(
"Do you programme every day? : ") ;
int answer = Console.ReadLine();
if (answer =="Yes")
{
Console.WriteLine(
"You will be a good programmer");
}
else
{
Console.WriteLine(
"You will not be a good programmer");
}
}
}
}
2 Stimmen
3 Antwortenhow can i put a program in an application ? i wrote a program with eclipse ( a calculator ) what can i do with it now ? maybe put it in an application but how ?
and is in this app (sololearn) declared how to program interactive fields ? like for calculator a field for + - * / and = ? is there any tutorial for that ?
2 Stimmen
5 AntwortenJava programming loop statements
0 Stimmen
2 Antwortenjava class Add quot;">"quot;
quot;;">"quot;;"awesome");"dolor""haha""hihi""hoho""huhu");"ipsum""is""sit"{}+=addadd("hehe"add("lorem"add("this"classconstructor(...words)newprint()returnthis.words 1 Stimme
4 Antworten#include <iostream>
using namespace std;
class A{
public:
void f1();
};
class B : public A{
public:
virtual void f1();
}
int main()
{
A * obj = new B;
obj.f1();
}
Ques: can we write virtual before an overridden function from the base class?? if yes which f1() should it call base class f1() or derived class f1()???
0 Stimmen
1 AntwortHey there,
I don't know why, but when I import tkinter on IDLE like this:
from tkinter import *
And I say:
window = Tk()
Even known I use python 3.2.5, which should be able to use Tkinter, the python shell raises a ValueError that says that Tk() is not defined. I am very sure I use python 3.2.5 and tutorials from the Python Foundation say that is what I have to do. But it still doesn't work.
Does anyone have an idea of how to solve this problem? Thank you!
0 Stimmen
3 AntwortenMatt reaches the final round of a treasure hunt. In this, he finds that as he proceeds there are flags with the number written on them at different positions. The difference between two consecutive flags can be either a or b. If he finds the number on the first flag is 0. Given three integer, first one is number of flags present, second is a and third is b. then return all the possible values for last flag for each test case.
hunt({3 1 2}) = {2 3 4}
0 Stimmen
2 Antworten