₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,324,996 members, 8,419,858 topics. Date: Thursday, 04 June 2026 at 03:24 AM

Toggle theme

Codemarshal08's Posts

Nairaland ForumCodemarshal08's ProfileCodemarshal08's Posts

1 2 3 4 5 6 7 (of 7 pages)

ProgrammingRe: Help Me Keep My Brain In My Skull! Solve This Logic! by codemarshal08(m): 6:14pm On Mar 27, 2016
uvalued:
$QuerySelects = "SELECT * FROM entry";
$array = array();
$Query = mysql_query($QuerySelects) or die (mysql_errno() . ": " . mysql_error(). "\n"wink;
while($result=mysql_fetch_assoc($Query)) {

$k = $k +1;
$array[] = $result["id"];
$i = $i +1;
if($i == 2)
{
print_r($array);

}
}
Check the below tip:
--------------------------
From the problem statement, i could recognize a pattern
values ==> 1,2,3,4,5,6,7,8,9,10
even numbers ==> 2, 4, 6, 8, 10
odd numbers ==> 1, 3, 5, 7, 9

//make a function to determine if a number is even or odd
// then make the below comparison
if the value i received from DB is an even number
add 1 to it
else
subtract 1 from it
ProgrammingRe: Help Me Keep My Brain In My Skull! Solve This Logic! by codemarshal08(m): 6:07pm On Mar 27, 2016
codemaniacs:
Go to phpmyadmin then edit your ID table to "auto increment" and click the check box and make it "primary". No need to code it
This obviously wont take care of the subtraction case.
ProgrammingRe: Help Me Keep My Brain In My Skull! Solve This Logic! by codemarshal08(m): 5:56pm On Mar 27, 2016
uvalued:
Happy easter to you all.

I have beeen cracking my brain for hours to solve this logic in php but with no succes in site and tried googling it was not clear. Here it goes.

I have this serial values 1,2,3,4,5,6,7,8,9,10 as id in my database. Using SELECT statement to call the values was ok. But here is my problem, I want 1 to be added to 1 from the database, 1 subtracted from 2 from the database, 1 added to 3 from the database, 1 subtracted from 4 from the database etc. Each operation should be added to an array which will be called later using for loop.

I thought of using array, if then else, i just cant rap my fingers around it, can someone help cry cry cry
Can you post the codes you have tried here ?
ProgrammingRe: "Qt Creator" Need Solution by codemarshal08(m): 10:46am On Mar 19, 2016
ijeezlux:
can you please name some of the complex data types that may vary with version
Hmm, Complex types == !buitIn types
ProgrammingRe: "Qt Creator" Need Solution by codemarshal08(m): 5:20am On Mar 19, 2016
ijeezlux:
hello gurus i have a little issue i need you guys to help me clarify ...... it goes like this.. when writing or reading data into qdatastream object, is it a must that i set the version of the Qt am using e.g (Qdatastream stream; stream.setVersion(...); ). i also have another question. i always see a certain quint32 magic_number variable when doing data serialization with Qdatastream object. but i dont really know whats the main function of this magic_number variable. is it a must to use it? it making me confused...... thanks in advance for ur answer
Bro have you read through this ?
http://doc.qt.io/qt-4.8/qdatastream.html#details
ProgrammingRe: Computer Science/programming Challenging Questions by codemarshal08(m): 6:43pm On Mar 07, 2016
airsaylongcon:
Consider the following pseudocode.

program main ()
begin
integer p, q, r, s
p = 6
q = 7
r = 8
s = fxn (p, q, r)
print s, p, q, r
end

integer fxn (integer a, integer b, integer c)
begin
if (a > 6) then b = 25
c = a + b
return b + c
end

If fxn uses call-by-reference, what values would be printed as a result of executing the pseudocode?
20, 6 , 7, 13
ProgrammingRe: Computer Science/programming Challenging Questions by codemarshal08(m): 6:32pm On Mar 07, 2016
airsaylongcon:
Consider the following pseudocode.

program main ()
begin
integer p, q, r, s
p = 6
q = 7
r = 8
s = fxn (p, q, r)
print s, p, q, r
end

integer fxn (integer a, integer b, integer c)
begin
if (a > 6) then
b = 25
c = a + b
return b + c
end

If fxn uses call-by-reference, what values would be printed as a result of executing the pseudocode?
Please, Does the if in the function have an [b]else [/b]part. Just want to be clear. I am not too convenient with pascal Syntax(i guess)
ProgrammingRe: Computer Science/programming Challenging Questions by codemarshal08(m): 6:02pm On Mar 07, 2016
airsaylongcon:
Sorry that's a typo. My brain meant to type q++ while my hand typed k++. My apologies
OK. the return value is 8

----------

1st comparison, q = 0 ----- 0%3 =====> 0, output = 0 + 1 = 1-----------1
2nd q = 1------1%3=====> 0. output = 1 + 1 = 2------------2
3rd q = 2------2%3=====> 0, output = 2 + 1----------------3
4th q = 3------3%3=====> 0, output = 3 + 1---------------4
5th q = 4------4%3=====> 1, output = 4 + q = 4 + 4-------8
ProgrammingRe: Computer Science/programming Challenging Questions by codemarshal08(m): 5:44pm On Mar 07, 2016
airsaylongcon:
Here we go guys

Consider the following function
int t ()
{
int q, output;
output = 0;
for ( q = 0; q < 5; k++ )
{
if ( ( q % 3 ) == 1 )
output = output + q;
else
output = output + 1;
}
return output;
}
What value is returned as a result of the call t () ?
A call to this function will cause an infinite loop. it will never return as the value of q is never incremented
ProgrammingRe: I Want To Learn Programming. Which Language Should I Start With? by codemarshal08(m): 4:04am On Feb 12, 2016
exxy:
Math Tutor

Purpose
This assignment is designed to help students in using C++ to perform basic calculations. Students will also gain experience with generating randon numbers.

Problem Statement
Write a program that can be used as a math tutor for a young student. The program should display two random numbers between 1 and 9 to be added, subtracted, multimplied, and divided, such as 3 * 9 =

After the student has entered an answer and pressed the [Enter] key, the program should display the correct answer so the student can see if his or her answer is correct.

Sample Output
3 + 9 = 12
That's Correct
3 - 9 = 6
Sorry, That's not correct, the correct answer is -6
3 X 9 = 27
That's Correct
3 / 9 = 0.333
Sorry, That's not correct, the correct answer is 0.

My Ogas I need some ideas on how to write the syntax
Bro, don't you think you are supposed to post this in the c++ help section ?
ProgrammingRe: "Qt Creator" Need Solution by codemarshal08(m): 5:50pm On Feb 01, 2016
bestiyke:
Please I someone to assist me.

I downloaded qt 5.5.1. first minGW off line installer, after installation, I run the qt creator only to see a blank window.
I taught it was not properly install. I uninstall it an reinstall, but it still repeat. Meanwhile, the qt designer, qt assistant and qt linguist are opening well. I try the online installer, the same thing happen. I downloaded and install stand alone qt creator 3.6.0. it still display a blank window.
Pls, I want to know what could be the problem and the possible solution. Thanks for the help. I know to qt. My system run on window 7
Can you provide some screenshots ?
ProgrammingRe: PHP Guys Please Help Me Solve This Problem by codemarshal08(m): 7:22pm On Jan 31, 2016
i will advice you try to solve them yourself first. You won't learn anything if you keep dropping it here.
Feel free to ask for help when you get stuck.
ProgrammingRe: PHP Guys Please Help Me Solve This Problem by codemarshal08(m):
WafiJoe:
<?php
$fam = array("Steve", "John", "Madu", "Cynthia" );

?>

That is all I got embarassed embarassed embarassed
Ok. Check this Out. Some PHP gurus here might have a better solution for you.


<?php
$arrayOfNames = array("Emmanuel", "Osas Omon", "Victor ekon", "Abu aliyu" ); // Creates an array of names
array_push($arrayOfNames, "grace owoh" ); // adds "grace owoh" to the end of the array
sort($arrayOfNames); // sort the array
$randomName = $arrayOfNames[rand(0, count($arrayOfNames)-1)]; // rand takes lower and upper limits
echo strtoupper($randomName); // output in uppercase


?>
ProgrammingRe: PHP Guys Please Help Me Solve This Problem by codemarshal08(m): 6:41pm On Jan 31, 2016
WafiJoe:
So I have been using codecademy lately to study programming. And things have been going fine but now I am stucked.
Bro show some codes and Point Where you are stuck !
ProgrammingRe: Hope For C++ Newbies: Gui Toolkits by codemarshal08(m): 10:33am On Jan 29, 2016
Forget about syntax for now. Try to solve it on paper first.
ProgrammingRe: Pls Help Me With This Php Code by codemarshal08(m): 9:30pm On Jan 21, 2016
lillylove2:
I cant believe all the programmers here are only programmers by mouth. It is well o
Please Show the code you tried.
ProgrammingRe: Hope For C++ Newbies: Gui Toolkits by codemarshal08(m): 12:42pm On Jan 17, 2016
exxy:
Hey, I am new to C++, i need all your help on how to start writing code and understand this language
Read Through this topic:
https://www.nairaland.com/2163116/want-learn-c-programming-language#31016123

come back for more Questions!
ProgrammingRe: Please, Programmers In The House I Need C++ Compiler by codemarshal08(m): 8:33am On Dec 09, 2015
elijah2u:
Please I need a c++ compiler where can I get it downloadedhuh Help your boy ooo
For a compiler, check this https://gcc.gnu.org/

For an IDE, check out codeblocks, Below is the URL
http://www.codeblocks.org/
ProgrammingRe: . by codemarshal08(m): 7:36pm On Nov 20, 2015
Hmm bro. what do you not understand in those codes ?
ProgrammingRe: Help On Qt Creator by codemarshal08(m): 7:39am On Nov 13, 2015
idlatest:
Guys please how can i display
selected row from QTableView if you have a two window. First is your
mainwindow with qtableview and the second window is dialog modal(true), in
which you have qlineEdits. How to send data to that second window?
Thanks in advance
Bro what have you tried ?
Anyway, check the suggestion Below !

Add a setter method to your Dialog then call this method from your mainWindow using the currentItem from the TableView as its Input.
Hope you get that line.
ProgrammingRe: Qt Help by codemarshal08(m): 5:33pm On Oct 30, 2015
Have You checked the documentation ?
http://doc.qt.io/qt-4.8/modelview.html
ProgrammingRe: C++ Programmers Help!!!!!!!!!!!!!!!!!!!!!!!! by codemarshal08(m):
hmm........your program structure is making it hard for me to scan through. Anyways, i tried to reproduce the error but your code kept giving me multiple errors different from the one you posted here
this is the error i get whenever i try to run the program
Please are you sure you were able to pass the COMPILE stage to the RUN stage ?
ProgrammingRe: Help With C++ Project by codemarshal08(m): 8:05pm On Oct 12, 2015
Where Are you stuck ?
ProgrammingRe: Hope For C++ Newbies: Gui Toolkits by codemarshal08(m): 7:06am On Jul 28, 2015
peterincredible:
for those dat are looking for a good qt text book for beginners download this book "foundation of qt development" and i promise u will be happy u were informed about this book
+1 for this recommendation !...... peter, hope u have gone far o
ProgrammingRe: Signs That You Are Not Meant To Be A Programmer by codemarshal08(m): 1:04pm On Jul 19, 2015
ProgrammingRe: I Want To Learn Software. Programing, Buh Where And How Do I Start by codemarshal08(m): 8:35pm On Jul 14, 2015
ifeoluwasegun:
Okay thanks, but if I won't be too worrisome, pls what are the steps to take?
I will try not to choose a language for you because it wont really help you.
* What do u want to program ? Game ? web applications ? desktop software ? - Get to know what interest you most.
* Pick a language Most suitable for your purpose -- you can use the Op's post as a guide on this. i will advice you stick with one language at this stage. please don't participate in language wars.
* Get a good book on the language & required environment setup
* Let Google.com be your friend.
* Practice , Practice , Practice .......... Read little and Practice More
* Keep Learning, it is a never ending process...
ProgrammingRe: I Want To Learn Software. Programing, Buh Where And How Do I Start by codemarshal08(m): 6:39pm On Jul 14, 2015
ifeoluwasegun:
TO THE GEEKS HERE:

Sorry for asking this, but is it possible to learn programming ordinarily by online turorials and e-books alone?

I mean without an instructor.
Yes it is Possible !
ProgrammingRe: Help!!! (design N Implemented Of A Company Website). by codemarshal08(m): 4:15pm On Jul 12, 2015
Do you mean you have been asked to "DESIGN AND IMPLEMENT A COMPANY'S (any company huh?) WEBSITE ?"
ProgrammingRe: Check In: Submit Your C++ Questions Lets Solve by codemarshal08(m): 8:08pm On Jul 06, 2015
nembudziya:
yeah, i guess so...... I am afraid i am going to spend the better part of my time trying to grasp c++, and by the time i reach......yrs i def must an expert. I tried reading the deitel and harvey text book, but man, i could not understand the jargon, but at least it got me thinking otherwise, anyways thanks bros.
yea, it isn't strange to feel that way. Every Pro u see speaking Codes was once in your stage. Just relax, define your goals and work your way to the top . its a step by step matter. Do check the book Jacob05 recommended, it will really get u started with Programming in general !


Note: read less and Practice more !
ProgrammingRe: Check In: Submit Your C++ Questions Lets Solve by codemarshal08(m): 1:49pm On Jul 05, 2015
nembudziya:
hmmmmmm..........i am astounded. Whats a console, though. Guy, i think you also have to help me on friendship and inheritance cos its one area i'd to master, plus pointers, wow, especially the *this pointer. Hope to hear from you concerning this one matter. Thanks in advance.
It seems you are a beginner programmer. I will advice you get a good c++ book as Jacob Suggested. These things are not as complex as you think.
C++ is not a language u rush over. just take your time and learn the damn Beast !

1 2 3 4 5 6 7 (of 7 pages)