Dyskusje Q&A
Who have DuckGame
0 głosów
6 odpowiedziwhile inside while loop
0 głosów
2 odpowiedzicorrect me if I'm wrong
0 głosów
2 odpowiedzi#include <iostream>
using namespace std;
class employee
int main()
{
private:
double salary;
public:
void getsalary(double sal)
{
salary=sal;
}
void display()
{
cout<<"the salary:"<<salary;
}
};
void main ()
{
employee programmer;
employee manager;
manager.getsalary (60000.0);
programmer.getsalary(40000.0);
manager.display();
programmer.display();
return 0;
}
1 Głos
5 odpowiedziSolve errors on this code
0 głosów
2 odpowiedziPublic, static and void
0 głosów
2 odpowiedziwhy is it not running?
import java.util.Scanner;
public class Myclass{
public static void main(String [] args){
Scanner in = new Scanner(System.in);
String a;
int b;
System.out.println("enter a word");
a = in.nextLine();
System.out.println("enter repetition")
b = in.nextInt();
for ( int = 0; x < b; x = x++)
System.out.println(a);
}
}
0 głosów
8 odpowiedziCan anyone help me?
0 głosów
5 odpowiedziCSS The text-indent property I do not understand why you would use this when the </br> tag takes the text back to the left hand side of the page, and as soon as I start a new class the first line of text in a paragraph even with a class it imprints onto every other paragraph like it or not. Why is this please?
0 głosów
2 odpowiedziI need help!
0 głosów
1 OdpowiedźWhy do we use "@classmethod"?
0 głosów
1 Odpowiedźpublic class Vehicle {
int maxSpeed;
int wheels;
String color;
double fuelCapacity;
void horn() {
System.out.println("Beep!");
}
}
class MyClass {
public static void main(String[ ] args) {
Vehicle v1 = new Vehicle();
Vehicle v2 = new Vehicle();
v1.color = "red";
v2.horn();
System.out.println(v1);
}
}
Explain its outcome. I am unable to get the last line of outcome.
-1 Głos
2 odpowiedzican someone help..
what does this code means so it could have the output like on the example..
class SpecialString:
def __init__(self, cont):
self.cont = cont
def __gt__(self, other):
for index in range(len(other.cont)+1):
result = other.cont[:index] + ">" + self.cont
result += ">" + other.cont[index:]
print(result)
spam = SpecialString("spam")
eggs = SpecialString("eggs")
spam > eggs
1 Głos
5 odpowiedziOutput of C++ code
0 głosów
2 odpowiedziurgent java
0 głosów
2 odpowiedziPopularne dzisiaj
Countdown Test
1 Votes
diary
1 Votes
Could anyone fix this?
0 Votes
how do i create a code
0 Votes
Fitting
0 Votes
Leecode?
2 Votes
How to hack public wifi
0 Votes
Module quiz not opening
1 Votes