Skip to content

4 weeks worth of tasks for both sem and prakt #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Borislav25Ivanov
Copy link

Борислав Иванов
кн 1 3mi0800548

Comment on lines +3 to +4
const size_t inputLenght=41;
const size_t PlateNumLenght = 9;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const size_t inputLenght=41;
const size_t PlateNumLenght = 9;
const size_t INPUT_LENGTH = 41;
const size_t PLATE_NUM_LENGTH = 9;

Comment on lines +8 to +10
mitsubishi,
mazda,
opel
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mitsubishi,
mazda,
opel
MITSUBISHI,
MAZDA,
OPEL

Comment on lines +24 to +26
red,
green,
blue
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
red,
green,
blue
RED,
GREEN,
BLUE

blue
};

struct car{
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
struct car{
struct Car{

"mazda",
"opel"
};
const char *colors[3] = {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

По-добре да изнесем 3 като константа отвън и долу да използваме нея вместо sizeof(brands/colors)/sizeof(char*).

ip/=16;
}
result[counter] = '\0';
reverseChar(result);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of doing reverseChar, you can just add them in reverse by doing the following:

result[counter] = hex[ip / 16];
ip %=16;

Comment on lines +41 to +44
size_t i =0;
while(result[i] !='\0'){
std::cout<<result[i];i++;
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need this.

Comment on lines +3 to +6
private:

double Re;
double Im;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good rule of thumb is to keep all the private stuff at the bottom of a class definition.


class Car
{
private:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the private part to the bottom.


void Complex::print()const {std::cout<<'('<<Re<<','<<Im<<")";}

Complex & Complex::operator= (const Complex c){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a clause like this to prevent unnecessary copying. We will talk about this later in the course.

if(&c == this) return *this;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants