Jump to content
Accelerated Evolution

Boolean Algebra and other shit


Recommended Posts

Taking computer archetechture to get my associates in computer networking but the class is proving to be rather difficutl. We are currently doing a unit on Boolean Algebra and Karaugh mapping but I just can't seem to understand it. I took a test today on the mapping thing and completely failed it (more due to reading comprehention but I would have failed it either way). So can any of you smarty pants help me out?

Link to comment
  • 2 weeks later...

Since I seem to be sucking at almost everything this time around in college, I'm going to make this a general computer science help thread.

Anyway I just had a C++ programming test that I was pretty confident that I was going to do alright in but I got hung up on ONE FUCKING THING when I tried compiling the program I was writing. Fortunatly the test allows for partial credit if you show that you at least know what the fuck you are doing but I still feel really fucking pissed that I could figure this one thing out. I would post the entire program here in this post but I feel like it might take up way too much space and misalignthe entire thread so I wont. If you actually to see what I wrote I can email the person the program as a .cpp file so you can few it on your computer.

Link to comment

Could put it inside a collapsible spoiler tag or code tag.

Do we have code tags?



^So do.



k

#include <cstdlib>
#include <iostream>
#include <cmath>

const float pi = 3.14;
float getRadius();
float computeVolume();
float computeSurfarea();
void displayResult(float v, float s);
using namespace std;

int main(int argc, char *argv[])
{
float r = getRadius();
float v = computeVolume();
float s = computeSurfarea();
displayResult(v,s);

system("PAUSE");
return EXIT_SUCCESS;
}
float getRadius()
{
float r;
cout << "What is the radius of the sphere?" << endl;
cin >> r;
return r;
}
float computeVolume()
{
float volume;

volume = (4/3)*pi*(r*r*r);
return volume;
}
float getSurfarea();
}
float surfarea;
surfarea = pi*POW(radius,2);
return surfarea;
}
void displayResult(float v, float s)
}

cout << "The volume of the sphere is " << v << ". The surface area of the sphere is"
<< s << endl;
}


The error I kept getting was that r was an undeclared variable
Link to comment

I don't think it'd make any difference, but try replacing your main with

float r;

        float v;

        float s;

        r = getRadius();

        v = computeVolume();

        s = computeSurfacearea();

        displayResult(v,s);


        system("PAUSE");

        return EXIT_SUCCESS;

If the code tag is what your file contains you'll need to get rid of the extra semicolon at the end of the function definition for getSurfacarea() and change the closing brace right after it to an opening brace (same with displayResult())

Link to comment
  • 2 weeks later...

k


#include <cstdlib>

#include <iostream>

#include <cmath>


const float pi = 3.14;

float getRadius();

float computeVolume();

float computeSurfarea();

void displayResult(float v, float s);

using namespace std;


int main(int argc, char *argv[])

{

	float r = getRadius();

	float v = computeVolume();

	float s = computeSurfarea();

	displayResult(v,s);


	system("PAUSE");

	return EXIT_SUCCESS;

}

float getRadius()

{

	float r;

	cout << "What is the radius of the sphere?" << endl;

	cin >> r;

	return r;

}

float computeVolume()

{

  	float volume;


  	volume = (4/3)*pi*(r*r*r);

  	return volume;

}

float getSurfarea();

}

  	float surfarea;

  	surfarea = pi*POW(radius,2);

  	return surfarea;

}

void displayResult(float v, float s)

}


 	cout << "The volume of the sphere is " << v << ". The surface area of the sphere is"

      	<< s << endl;

}

The error I kept getting was that r was an undeclared variable

r is not declared as a global variable, only as a local. Thus, delcaring it as a global will allow all routines to reference it...

Link to comment

Basic Logic circuits for starters; taking boolean statments and turning them into a logic diagram in some like Circuit maker or simply drawing it out on paper. We've also starting doing stuff with Flip-flops, exitation tables and sequential circuits

I think you mean function block logic verus circuits, but circuits are ultimately built with this type logic at the simplified level. This will be and, or, nor, xor, xnor and similar boolean logic. There are places on the web to find help, but you won't have them available on exams which will be crucial and extremely frustrating if you rely on an external media. Learn the boolean algebra, it is the only means of passing a digital logic class. It has been a while since I have had the class, but will attempt to help with specific examples...

Link to comment
  • 3 weeks later...

OK here is my latest CPP assignment due this thursday at 4 AM:

A prime number is a number that is divisible only by itself and 1. Write a program that asks the user for an integer value and then displays all prime numgers less than or equal to that number.

I am supposed to use for and I am guessing while statements as well as give the first three steps of the software development method.

Link to comment
  • 3 months later...

New semester, new set of problems. I am now taking a C# class and am really struggling with the material. This is my current assignment, which I have no clue how to complete:

Create a GUI program which asks the user how many stars they want to display and then display the stars in random positions with random colors. Use a text box to get the number of stars from the user and button to start star generation. It is recommended that you create a Star class as a separate class from the form class.

Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...