F&A Diskussionen
Python Program Structure: How?
1 Stimme
1 AntwortPublic, static and void
0 Stimmen
2 Antworten#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 Stimme
5 AntwortenCan you help me with this ?
0 Stimmen
3 Antwortenwhere's the error ?
-3 Stimmen
2 AntwortenWrite a program that uses a dynamic array that contains 5 items of double values. The size of the array is entered when the program is run. Aldo the 5 values must be entered. These tasks are done in the main ( ) function. Then write a function to display the 5 values. The function must have a pointer variable as a parameter. The function is called from the main ( ).
0 Stimmen
2 AntwortenWhy is not working
0 Stimmen
3 AntwortenAdding onto an output file?
1 Stimme
2 Antwortena)Write a function ‘rev’ which returns the reverse of the given integer. Function isPalin takes an integer as argument and checks whether it is palindrome or not using rev function. Using isPalin write a main function to accept n integers and display number of palindrome numbers found.
b)write a program to find the possible permutations of the given word .
0 Stimmen
2 AntwortenHeader file of C++
0 Stimmen
1 AntwortIn the short code below, I declared an array of five elements. But I'm getting confused on how to use it in a while loop. My main question is , if the user inputs a userchoice1 value that is less than 1, I want the code to keep looping until the user inputs a number that is not less than 1. But I don't know if the 7th line (userchoice1 [x]++) shows the right way to loop it.
1 Stimme
2 AntwortenWhat is the output and why?
public static int[] make (int n){
int[]a=new int [n];
a [i]=i+1;
}
return a;
}
public static void dub (int []jub){
for (intent i=0;i <jub.length;i++){
jub*=2;
}
}
public static int mus (int []zoo){
int jus=0;
for (int i=0;i <zoo.length;i++){
jus+=zoo [i];
}
return jus;
}
public static void main (String [] args){
int [] bob =make(5);
dub (bob);
System.out.println (mus (bob));
}
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 AntwortenWhy not working
-4 Stimmen
4 AntwortenHeute heiß
Sticky position
3 Votes
Help please?
3 Votes
Ejercicio Pytho
0 Votes
Online voting system
2 Votes
What is that z for
0 Votes
Suggestions needed
4 Votes
SQL practice
2 Votes