I was a bit unsure of a few things that we were doing, so this is a bit late. With the emails that we have received via alpine I am a bit more clear where we stand. So I am a quite late on actually getting to the first of my dated Opus entries, though I enjoy more being inside the “lair” or email, its probably a good thing I begin this documentation part of the class.
I picked up a few good things I am sure I will be making use of throughout this semester,
gcc -o programname sourcecode.c - Then run them:
./programname Where sourcecode.c = the actual file created with Nano programname = the name of the program created when the file is compiled.
Lastly to finish this entry, I am not quite sure if there is a data base for where we are suppose to be getting Keywords from or if they are just picked up as we go.
I plan to begin working on making a Number conversion from Decimal to Hex for one of my beginning projects.
So I spent a good amount of time last night, because once again awesome folks at xda have a bit on dx2, working on flashing different roms to my phone. Though I wound up restoring the Nand back-up I had to make there was a few decent roms which show a promising future.
-moto blur taken out
-bloatware removed
-Root access (not the roms doing)
The bootstrap for this phone (Droid x2) has yet to be as solid as the other ones.
-can only gain access to it via running it through the apk on the phone. -It is wiped with data if on the ROM install.
The Rom I played with, though I did not spend too much time with it was that of eclipse .6 remix. The problem I did not like is you have to currently wipe data when installing so contacts and all are a pain process to port back onto the phone. The Facebook contacts sync isn't active, but should be released in .7. There is a face book app I read about to help sync it but just not as solid of a built ROM, hoping cyanogen will have his work released soon for the Droid x2.
Today I spent a few hours reading into some beginner tutorials on C/C++. Made a few stupid programs that do pretty much nothing, but helped me start to get a better understanding of how things work, and how to write a little.
Made one with a age input, favorite day input and plan to do a few more once I am done with this if I have time later after I get other homework done. All in all slightly accomplishing day considering was one of the very few people who successfully got our windows 7 unattend.xml to properly work.
Well today I was kinda excited after class because I picked up a HP touch pad. I spent most of my night distracted by it, creating a partition for ubuntu and getting it installed. Unfortunetly my work with it was cut short with a call from family, our grandmother on moms side just passed, exactly 3 months from the passing from our mom. As most of you can guess alot of my time has been with family and trying to keep positive about all of this.
Are allocated blocks of storage in memory that we can associate with a name, such as “pirce”, “age”, “year”, etc.
Name Type Range
int Numeric - Integer -32 768 to 32 767
short Numeric - Integer -32 768 to 32 767
long Numeric - Integer -2 147 483 648 to 2 147 483 647
float Numeric - Real 1.2 X 10-38 to 3.4 X 1038
double Numeric - Real 2.2 X 10-308 to 1.8 X 10308
char Character All ASCII characters
Examples of variables can be but not limited to:
int x %d short x %d long x %d char x %c float x %f double x %lf
The sizeof operator gets the size of its operand.
This initializes X to the size of c, resulting in a integer of the type size_t:
size_t X = sizeof(c);
The preferred method of performing input and out. The three I/O connections are called standard input (stdin), standard output (stdout) and standard error (stderr). -Standard input is data (often text) going into a program. -Standard output is the stream where a program writes its output data. -Standard error is another output stream typically used by programs to output error messages or diagnostics.
#include <stdio.h> printf() scanf()
A header file is a file containing C declarations and macro definitions to be shared between several source files. You request the use of a header file in your program by including it, with the C preprocessing directive `#include'.
example:
#include header.h #include <stdio.h> #include <math.h>
Binary arithmetic operators are +, -, *, /, and %.
int a = 25; int b = 5; int c; c = a + b; printf( "a + b = %dn", c ); c = a - b; printf( "a - b = %dn", c ); printf( "a * b = %dn", a * b ); c = a / b; printf( "a / b = %dn", c ); c = 100 % 3; printf( "a % b = %dn", c );
and && groups left to right, returns 1 on unequal comparison, and 0 anything else. or || groups left to right, returns 1 if if either of its operands compare unequal to zero, and 0 otherwise.
In computing, a C string is a character sequence terminated with a null character
In the following, the string literal “hello world” is printed.
/* * Sample code block */ #include <stdio.h> int main() { printf("hello world"); }
The variable initialization allows you to either declare a variable and give it a value or give a value to an already existing variable. Second, the condition tells the program that while the conditional expression is true the loop should continue to repeat itself.
FOR - for loops are the most useful type. The syntax for a for loop is
for ( variable initialization; condition; variable update ) { Code to execute while the condition is true }
while loop is like a stripped-down version of a for loop– it has no initialization or update section. However, an empty condition is not legal for a while loop as it is with a for loop.
while ( condition ) { Code to execute while the condition is true }
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
allow the programmer to store more than one value in a variable. An array is the equivalent of a box divided into partitions, each containing a piece of data. so this means an array is- An array is a series of elements of the same type placed in memory locations that can be individually referenced by adding an index to a identifier.
type name [elements];
int array [5] = { 0, 1, 2, 3, 4 };
this initializes the array to 5 place holders
accessing array elements
array[0]; //value of '0' array[1]; //value of '1' array[2]; //value of '2'
Trying to access a value outside the bounds of index 1 through size_of_array – 1, results in runtime errors. Your compiler will not complain, but your program will crash when it executes.
multi-dimensional arrays are arrays of arrays.
#define WIDTH 2 #define HEIGHT 5 int multiarray [HEIGHT][WIDTH]; int n,m;
this initializes the multi-dimensional array to 2 dimensions of a 5 element array
To open a file you need to use the fopen function, which returns a FILE pointer. Once you've opened a file, you can use the FILE pointer to let the compiler perform input and output functions on the file.
you first need a pointer such as
FILE *fp;
You then need to use this pointer and point to the file and what you intend to do with it
FILE *fp; fp=fopen("c:\\test.txt", "r");
r - open for reading
w - open for writing (file need not exist)
a - open for appending (file need not exist)
By the end of this semester show the ability to demonstrate the use of logic and structure in program writing.
The method of this could be variously described, but a easy effective means would be to ask a student to create a set of instructions that:
1. creates a program
2. Initializes the program
3. contains a logical sense to obtain a desired result, IE: if someone wanted to multiply 2 numbers and get a result.
To asses how a students effectiveness was in creating this first:
1. Does the program compile without errors.
2. Does the program ask for input for the 2 variables to be multiplied.
3. Does the program give the correct desired answer for this function it is to serve.
4. Lastly the code in which it is written, was it initialized properly, does it only prompt the user for one occurring event, Does it ask the user to input a variable to end, does it continuously loop and not close itself without the user having to exit the program, there is a large list in structuring the means to a achieved goal and many ways to reach it, but in the end was it the most efficient.
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
What is the use of \n and to what effect does it have if in a simple program designed to print “hello world” if:
1. it exists.
2. it does not.
created a simple program that says “hello world”
1.
#include <stdio.h> void main() { if(printf("Hello World\n")) }
2.
#include <stdio.h> void main() { if(printf("Hello World")) }
Based on what I know the function of /n is, to tell the program next line, I think it either will not compile, or it will not display “hello world” on its own line creating a new line after execution. State your rationale.
As listed in resources I created 2 programs to test one with one without, and plan to run both and record the results.
1.
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
2.
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World!lab46:~/src$
Based on the data collected:
Based on the data collected, It is obvious the use, and results of having /n in program syntax, where as if it does not exist what will happen.
What is the question you'd like to pose for experimentation? State it here.
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
How are you going to test your hypothesis? What is the structure of your experiment?
Perform your experiment, and collect/document the results here.
Based on the data collected:
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.