Icon Crear Crear

Programming Practice

Completar frases

(2)
Practice for C++

Descarga la versión para jugar en papel

Edad recomendada: 17 años
11 veces realizada

Creada por

Estados Unidos

Top 10 resultados

  1. 1
    00:58
    tiempo
    100
    puntuacion
  2. 2
    01:42
    tiempo
    100
    puntuacion
  3. 3
    07:10
    tiempo
    13
    puntuacion
¿Quieres aparecer en el Top 10 de este juego? para identificarte.
Crea tu propio juego gratis desde nuestro creador de juegos
Compite contra tus amigos para ver quien consigue la mejor puntuación en esta actividad

Top juegos

  1. tiempo
    puntuacion
  1. tiempo
    puntuacion
tiempo
puntuacion
tiempo
puntuacion
 
game-icon

Completar frases

Programming PracticeVersión en línea

Practice for C++

por Liz Smith
1

p2 namespace void Move int initY int p2 initX endl 0 Print newY cout Point p1 newY y Move x y newX Print

/ *
Purpose : declare a Point class type with inline member function to model a 2D point
* /

#include iostream / / for streaming i / o
using std ; / / reserve library for standard use

/ / declare the Point class to model a 2D point
class Point
{
public :
( ) { = ; y = 0 ; } / / the default constructor
Point ( int initX , int initY ) { x = ; = ; } / / the explicit contructor
void Print ( ) const { cout << " ( " << x << " , " << y << " ) " ; } / / to print a point
( , ) { x = newX ; = ; } / / to move a point
private :
int x ; / / the x coordinate
int y ; / / the y coordinate
} ;

int main ( )
{
Point p1 , / / declare a point at ( 0 , 0 )
p2 ( 1 , 2 ) ; / / declare a point at ( 1 , 2 )

/ / display p1 and p2

cout << " p1 = " ;
p1 . Print ( ) ;
cout << endl ;

/ / move p1 to ( 3 , 6 )
. ( 3 , 6 ) ;

/ / assign p1 to p2

p2 = p1 ;

<< " p2 = " ;
. ( ) ;
cout << ;

cout << " p2 = " ;
. ( ) ;
cout << endl ;

/ / successfully done
return 0 ;
}

educaplay suscripción