No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
14 Posted Topics
I have to convert a piece of C++ code to Python. Except I can't understand what it's doing. This is the code: [CODE]#include <iostream> using namespace std; int calculate(int values[], int size) { int answer = 0; for (int 1 =0; i< size; i +=1) } answer += values[1]; } … | |
I am working on a program with classes and a main function. This game involves tanks moving around a grid of defined size, and shooting at each other. Each tank has a name, armour and firepower. On the grid, there are randomly generated squares that contain extra armour or firepower. … | |
Hi I am trying to write a query that will return the gold, silver, and bronze medalists for each individual-based event. The relational schemas are: EVENT(Event_id, Event_title, Event_team, Event_gender, Sport_id) GAME(Game_id, Gtype_id, Game_year, game_website, game_cancel, Country_id) GAMETYPE(Gtype_id, Gtype_title) SPORT(Sport_id, Sport_title, Gtype, id) CONTESTANT(Cont_id, Rep_id, Comp_id, Team_id) MEDAL(Medal_id, Medal_color, Cont_id) REPRESENTATIVE(Rep_id, … | |
I have a query that has two counts in an if statement. I need the query to return all values even if they are null once equated by count. I have tried the NZ function to no effect. Any help would be greatly appreciated. [CODE]SELECT REPRESENTATIVE.Country_id, IIf([CONTESTANT.Team_id] Is Null,COUNT(*),COUNT(*)-1) AS … | |
I'm writing a query that will produce the athlete's id, their name (first name and last name combined into one column), the total number of games they have participated in, and the total number of medals they have won. This involves a number of tables. In one query, the number … | |
I'm just playing around with basic GUI code. I have created two check boxes, and a text field below them. I want it to say, "I like Pizza", 'I like Pasta", "I like nothing", or "I like Pizza and Pasta" in the text field depending upon which checkboxes are ticked. … | |
I am trying to define a function that draws a triangle of a given size using the turn method. I've never used turtle graphics before and am not sure how to go about this. Thank you | |
I changed the RAM in my computer to two 2gb sticks, and when I tried to power up I only got the LED light on the back on the CPU flashing, and the computer won't boot up. It is a Compaq Presario SR1000. I have tried removing the RAM and … | |
How would you define a recursive function that asks the user for a string and prints it from the outside in. For example, 123456 would print as 162534. Any help would be appreciated. | |
Just a quick one- I'm writing code that asks the user for a filename and checks that it exists. If it does it has to print the file's contents, if not print a message. [CODE]import os fileName = raw_input("Enter the name of the file: ") if os.path.exists(fileName) == True: fileName.read() … | |
I have created a number guessing game that writes and reads scores from a text file. When a section of code was added to sort and right-align the scores from lowest to highest, a problem was encountered. This is my code: [CODE] import random print "Welcome to the Great CP1200 … | |
Hello In my program I have a text file that I read from and write to. However, I would like to display the contents of the text file in an alligned and sorted manner. The contents currently read- name, score name, score Would I have to convert this information into … | |
Hello In my program I am using a menu that uses a multi-way if statement to do what the user inputs (1 of 3 values). After printing the menu I use a raw input statement to get the user's input. However, is there anyway to define the user's input variable … | |
Hello I'm writing a python program and need some help. Firstly, is there anyway to include variables in an input prompt? For eg. [variable1 = 4 variable 2= 3 variable= raw_input("Please enter a number between", variable 1, "and", variable2) ] Also, if data is being appended to the end of … |
The End.