Well..finally…I´ve complete all my mastery videos, and now is time to study for finals…
thank you for all TC1017, and ken…keep up with the good work
Here´s the link of the video:
https://www.youtube.com/watch?v=ewnkks0awTs
Well..finally…I´ve complete all my mastery videos, and now is time to study for finals…
thank you for all TC1017, and ken…keep up with the good work
Here´s the link of the video:
https://www.youtube.com/watch?v=ewnkks0awTs
So…this project turns out to be one of the most difficult ones, I mean, we were trying to make it work with pixels but it was like hell, first you need to initialize variables with pixels, then put them into an array and then do more stuff, so well…it was like hell, Marco and I spend like 4 hours today trying to understand the whole thing, I´m si freaking tired of final projects in every single course, but well, in this course I did it just fine, but I struggle too much on this project…at least I finally complete it.
I know how to do the first instruction, which is change colors to black and white with pixels, but the other one, the one that resizes the Image to %50 its original size, well…I was forced to do it with a single function…I haven´t enough time…but yeah…life goes on and I learn a lot trough this programming course.
Here´s my code.
https://github.com/kenwbauer/TC101F15_Team01/blob/master/projectfinal_final.cpp
here´s the link of my masteries
Here´s my quiz 11, it was a little more complicated than I thought, but in the end I receive some help from my friends Marco Patiño and Esaú Preciado, and well they teach me how to do the programms.
so here are my programms
q1.
#include <iostream>
#include <iomanip>
using namespace std;
void newline(){
cout<<endl;
}
double factor(int a){
double output= 1.0;
for (int i = 1; i <= a; i++){
if (a == 0)
return output;
else
output = output * i;
}
return output;
}
double define_e(int exact){
double output1 = 0.0, output2 = 1.0;
for(int i= 1; i<1000 ; i++){
output1 = output2;
output2 = output1 + (1/factor(i));
}
cout << fixed << setprecision(exact) << output2 << endl;
return output1;
}
int x = 0;
int main(){
float e;
string z;
cout<<"Hi, I´m a calculator of the e constant "<<endl;
newline();
cout<<"Please insert how precisely you want this mathematical constant "<<endl;
newline();
cin>>e;
newline();
cout<<"The result equals to "<<define_e(e)<<endl;
newline();
}
return 0;
}
q2.
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main(){
string Read;
string Banana = "banana";
char archive[50];
int x = 0;
int y = 0;
int counter = 0;
cout << "Write the name of your file: ";
cin >> archive;
ifstream read_file (archive);
if (read_file.is_open()){
while (getline(read_file , Read)){
x = 0;
while (x < Read.length()) {
char character = Read[x];
if ( character == 'B' || character== 'b'){
y = x + 1;
char character = Read[y];
if (character == 'A' || character== 'a'){
y++;
char character = Read[y];
if (character == 'N' || character== 'n'){
y++;
char character = Read[y];
if (character == 'A' || character== 'a'){
y++;
char character = Read[y];
if (character == 'N' || character== 'n'){
y++;
char character = Read[y];
if (character == 'A' || character== 'a') {
counter++;
}
}
}
}
}
}
x = x + 1;
}
}read_file.close();
}else{
cout << "Error 404 not found" << endl;
}
cout << "I found " << counter << " bananas....So eat them all!!!...or not..." << endl;
return 0;
}
Also on github.
Program1.
https://github.com/everibarra/TC101-C-/blob/master/quiz11q1.cpp
Program2
https://github.com/everibarra/TC101-C-/blob/master/quiz11q2.cpp
We finally did the project, we just need to adjust some functions, because we were using functions from theimagemagick library, tomorrow we´re going to change the programm and see if it runs with arrays.
here´s the code:
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
void newline(){
cout<<endl;
}
int main(int argc,char **argv)
{
InitializeMagick(*argv);
try{
int x;
cout<<"Hi, Im a manipulator of images "<<endl;
newline();
cout<<"What do you want to do? (press the number in your keyboard) "<<endl;
newline();
cout<<"1. Rezise the image to one half of its original size"<<endl;
cout<<"2. Switch to black and white"<<endl;
newline();
cin>>x;
if(x==1){
newline();
cout<<"Alright, now introduce the name of the file with its extension; example: new.jpg"<<endl;
newline();
Image image;
string img;
cin>>img;
image.read(img);
image.minify();
image.write("resized.jpg");
}
if(x==2){
newline();
cout<<"Alright, now introduce the name of the file with its extension; example: new.jpg"<<endl;
newline();
Image image2;
string img2;
cin>>img2;
image2.read(img2);
image2.quantizeColorSpace( GRAYColorspace );
image2.quantizeColors( 256 );
image2.quantize( );
image2.write("blackandwhite.jpg");
}
}
catch( Exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}
Here´s the video for the Bonus percent.
So, right now I technically push even forward my programming skills, I mean…using imagemagick is a little bit hard, but today I compile some code and it runs!!!
Marco and I manage to resize the image to one half of its original size, but now we´re struggling with the grayscale functions and stuff, at least we have something to keep working on and we feel positive about the results in our final project.
We find some useful functions in the following pages:
http://www.imagemagick.org/script/perl-magick.php
http://www.imagemagick.org/Magick++/Color.html#ColorGray
#include <Magick++.h>
#include <iostream>
using namespace std;
using namespace Magick;
void newline(){
cout<<endl;
}
int main(int argc,char **argv)
{
InitializeMagick(*argv);
try{
int x;
cout<<"Hi, Im a manipulator of images "<<endl;
newline();
cout<<"What do you want to do? (press the number in your keyboard) "<<endl;
newline();
cout<<"1. Rezise the image to one half of its original size"<<endl;
cout<<"2. Switch to black and white"<<endl;
newline();
cin>>x;
if(x==1){
newline();
cout<<"Alright, now introduce the name of the file with its extension; example: new.jpg"<<endl;
newline();
Image image;
string img;
cin>>img;
image.read(img);
image.minify();
image.write("resized.jpg");
}
if(x==2){
newline();
cout<<"Alright, now introduce the name of the file with its extension; example: new.jpg"<<endl;
newline();
Image image;
string img2;
cin>>img2;
image.read(img2);
image.quantize(colorspace.gray);
image.write("blackandwhite.jpg");
}
}
catch( Exception &error_ )
{
cout << "Caught exception: " << error_.what() << endl;
return 1;
}
return 0;
}
The first option is the only one that works, we are going to keep working with the colors.
See you later!
HI ken! I did my Bonus quiz about the EcoasIf you want extra points just do it
So, for this WSQ I need to make a plan to survive the semester.
First of all I need to focus on all my subjects, I know that I wont failed any of them, but I want good grades! so here´s what I need to do:
-Complete all my WSQ´s and masteries on November 20th.
-Complete my final projects of every subject.
-Study even harder for the exams and quizzes.
-Being positive.
-Never surrender.
I´m a future engineer, and engineers find solutions to every problem!