Notes, abstracts, papers, exams and problems of Computers to Bachelor

Showing results 0 - 10 of 11 12»

Clasified in Notes of Computers of Bachelor.

Written at June 14, 2010 on enEnglish with a size of 1,143 bytes.

STRING

Obtenção de substrings
Podem ser utilizados os métodos assign ou substr:
string s1 = "Mackenzie", s2, s3;
s2.assign(s1); // Copia s1 para s2 (mesmo que s2 = s1;)
cout << s2 << endl; // Exibe Mackenzie
s3.assign(s1,0,4); // Copia 4 car. de s1 para s3 começando em 0
cout << s3 << endl; // Exibe Mack
cout << s1.substr(0,4) << endl; // Exibe Mack

Em Linguagem C++ (usando método da classe):

string s = "Sergio";
cout << s.length() << endl; // Exibe 6

string s1 = "abcdef";
s1.erase(2,3);
cout << s1 << endl; // Exibe abf
s1.insert(2,"cde");
cout << s1 << endl; // Exibe abcdef

string frase = "Universidade Faculdade Escola";
int p;
p = frase.find("dade",0);
cout << p << endl; // Exibe 8
p = frase.find("dade",13);

... (Continue)
Karma: 0%
1 Hits

Clasified in Notes of Computers of Bachelor.

Written at June 14, 2010 on enEnglish with a size of 1,172 bytes.

ENCAPSULAMENTO

#include <iostream>
#include <cmath>
using namespace std;
class Ponto
{
private:
double x;
double y;
public:
void setRet(double x, double y);
void getRet(double &x, double &y);
void setPol(double a, double r);
void getPol(double &a, double &r);
};
void Ponto::setRet(double x, double y)
{
this->x = x;
this->y = y;
}
void Ponto::getRet(double &x, double &y)
{
x = this->x;
y = this->y;
}
void Ponto::setPol(double a, double r)
{
x = r * cos(a);
y = r * sin(a);
}
void Ponto::getPol(double &a, double &r)
{
a = atan(y/x);
r = sqrt(x*x+y*y);
}
int main(int argc, char *argv[])
{
Ponto p1, p2;
double x, y, a, r;
p1.setRet(2,2);
p1.getPol(a,r);
cout << "a = " << a << " e r = " << r << endl;

... (Continue)
Karma: 0%
0 Hits

Clasified in Homeworks of Computers of Bachelor.

Written at June 14, 2010 on enEnglish with a size of 3,835 bytes.

MAIN

#include <cstdlib>

#include <iostream>

#include <string>

#include "triangulo.h"

using namespace std;

int main()

{

    triangulo tri;

    double areat,peri;

    string nomet;

    tri.setladoa(5);

    tri.setladob(4);

    tri.setladoc(9);

    peri=tri.perimetro(peri);

    areat=tri.area(areat);

    tri.classifica(nomet);

    cout << "Lado a   :"<< tri.getladoa()<<endl;

    cout << "Lado b   :"<< tri.getladob()<<endl;

    cout << "Lado c   :"<< tri.getladoc()<<endl;

    cout << "Perimetro:"<< peri<<endl;

    cout << "Area     :"<< areat<<endl;

    tri.classifica(nomet);   

    system("PAUSE");

    return EXIT_SUCCESS;

... (Continue)
Karma: 0%
0 Hits

Clasified in Notes of Computers of Bachelor.

Written at November 09, 2009 on enEnglish with a size of 1,680 bytes.

LUNAS

Dim i As Integer

Private Sub Form_Load()

End Sub

Private Sub imairudi_Click()

End Sub

Private Sub Timer1_Timer()
imairudi = imailargi(i)
i = i + 1
If i = 7 Then
i = 0
End If
End Sub


 

SACERDOTE


Private Sub Cmdonartu_Click()
If txthitza = "sacerdote" Then
lblasmatu = "Zorionak asmatu duzu!"
Else
lblasmatu = "ez duzu asmatu"
End If
If txthitza = "sacerdote" Then
imadolar.Visible = True
End If
End Sub

Private Sub Image1_Click()

End Sub

Private Sub Form_Load()

End Sub


 



... (Continue)
Karma: -1%
25 Hits

Clasified in Notes of Computers of Bachelor.

Written at May 31, 2009 on enEnglish with a size of 831 bytes.

1) 1-admit 2-have risked 3-insult 4-operated 5-left behind 6-evidence 7-beat 8-steps 9-top secret 10-proudly 2) 1a 2a 3b 4b 5a 3) 1-she likes neither hip-hop nor heavy metal music 2-my grandparents have got both a house in the country and a flat in the city 3-I am going to buy either the blue shirt or the red shirt 4) 1-am going to have/get/am having/getting my ears pierced 2-had/got it delivered 3-having/getting my photograph taken 5) 1.has been explored 2-believe 3-will be helped 4-is covered 6) 1-the suspect is being questioned at the moment 2-is good food served at the new thai restaurant? 3-that decision should have been made earlier 4-our conversation was being listened to 5-the dog hasnt been seen since saturday 7) 1-in order to/to 2-so as not to 3-since 4-so/so that 5-in order to/to
Karma: -11%
10 Hits

Clasified in Notes of Computers of Bachelor.

Written at May 31, 2009 on enEnglish with a size of 830 bytes.

1) 1-on time 2-pre 3-il 4-everyone 5-were arrested 6-a great 2) 1-embarras 2-tempt 3-method 4-prospect 5-trap 6-pass up 3) 1-....-success-succesful-succesfuly 2-end-ence-ofensive-fuly 3-...-ment-sing-gly 4- 5-inform-information-informative-ly 4) 1- 2-succesfully 3-he 4-offensive 5-embarrass 5) 1-complained 2-wondered 3-recommened 4-warned 6) 1-is hadnt stopped raining that day 2-not to go near her dog 3-(that)we(should)try/trying that new italian restaurant 7) 1-my sister asked if/ whether she could borrow my black sweter 2-jason asked whe they had seen the film crash 3-lisa asked how he was getting to the party 4-he emguired if/whether they had ever been to london 8) 1-had been sold 2-was 3-had warthed 4-to get .id of 5-would leave 9) 1-yours 2-although 3-so 4-new,red,italian 5-eventually
Karma: -13%
10 Hits

Clasified in Notes of Computers of Bachelor.

Written at May 21, 2009 on enEnglish with a size of 469 bytes.

1-eff, cam, deal, grab, items 2- 1,2,2,1,2 3- in, under, dis, im, un 4- about, of, in, for with, on, to 5- a2 3b 4c 1d 6- wont understand.dont concentrate, wouldnt have dont.hadnt studied, decide.will let, won.would travel 7- 2,1,1,2,1
1- in, set up, des, pop, face 2- una, cust, effo, deal, grab, items 3- independent, underestimate, disadvantages, impossible, unlikely, reread 4- argument about, lack of, objection to, apology for, effect on
Karma: -16%
7 Hits

Clasified in Notes of Computers of Bachelor.

Written at May 21, 2009 on enEnglish with a size of 329 bytes.

1) 2- 1.b 2.c 4- 1.heel 2.grab 3.rate 4.thrown out 5.accomplishment 2) 1- 1.b 2.b 2- 1.share 2.old hat 3.prevalent 4. donning 3) 1- are going to use a credit card 2- 1.b 2.a 3- f,t,t 4- resemble, fail apart, staple, look, artificial 4) 2- f,t 3- 1.b 2.c 4- casual, resemble, fail apart, look, currency
Karma: -16%
7 Hits

Clasified in Notes of Computers of Bachelor.

Written at May 31, 2009 on enEnglish with a size of 915 bytes.

1) 1-a.gather b.shown up 2-a.pass up b.prospect 3-a.methods b.tempts 4-a.suspects b.criminals 5-a.host b.broadcast 2) 1a 2b 3a 4b 5b 3) 1-decide 2-informative 3-ofiend 4-embarrassament 5-successfully 4) 1-dana said that she was going to the shopping centre the herd/following saturday/the saturday after 2-ben complained that it hadnt stopped raining 3-the woman warned us/me/them not to go near that dog 4-mona imcommended that I/we go to the new chinese restaurant that night 5-my mother offered to drive me to school the neig/following day/the day after 5) 1-had been sold 2-was 3-had wanted 4-to 5-would leave 6) 1-is this bag yours? 2-we had a good time although the weather was bad/ although the weather was bad, we had a good time. 3-I had a big lunch because I was hungry 4-jim has got an expensive, red, italian moped 5-first, we went to the cinema and then, we went to the..
Karma: -18%
6 Hits

Clasified in Notes of Computers of Bachelor.

Written at May 31, 2009 on enEnglish with a size of 791 bytes.

1) 1b 2a 3a 4a 5b 2) 1-admit 2-risk 3-insult 4-operates 5-leave behind 6-evidence 3) 1-she likes neither hip-hop nor heavy metal music 2-my grandparents have got both a flat in the city and a house in the country 3-I am going to buy either the red shirt or the blue shirt 4) 1-am going to have/get/am having/getting...pierced 2-have/get...shotered 3-having/gatting...taken 4-have/get...checked 5-have had/have got...repaired 5) 1-has been explored 2- believe 3-will be helped 4-is covered 6) 1-the suspect is being questioned now 2-the good food served at the new thai restaurant? 3-that decision should have been made earlier 4-our conversation was being recorded 5-the dog hasnt been seen since saturday 7) 1-to 2-so as not to 3-since 4-so that 5-in orther to
Karma: -20%
5 Hits
© Wikiteka, 2010
Chuletas  |  Apuntes