- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
15 Posted Topics
hey all..if I have a 5 files in PDF named PDF1, PDF2, PDF3, PDF4, PDF5 I want to create a program that renames them to project 1, project 2, project 3, project 4, project 5 import os,sys namelist=['jon', 'leon', 'david', 'nombre',] for filename in os.listdir("C://YOUR/PATH/HERE/"): os.rename(filename, namelist.pop()) print "succesfuly renamed" … | |
[CODE]// bintodec.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <string> using namespace std; int main(){ string inp; int dec = 0; char base; cout << "Input a number: "; cin >> inp; cout << "Input the base your number is in: "; … | |
Hey guys Im trying to create a code where: input A: number Input B: Base Print: Decimal form I am going to use algorithm where u do following: NUMBER % BASE but it would do it the number of times that the base is.. so if its 6 (base 2) … | |
can someone please give me some basic code sample using MOD op for decimal to binary up to BASE 10 ty ex. input 110 base 2 print 6 | |
Ok so for this assignment I have to have integer input in string and convert to integer..done: [CODE]int n, digit; cout << "Enter a number: "; cin >> snum; n = 0; int power = pow(10, snum.length()-1); for (int i=0; i<snum.length(); i++) { digit = snum.at(i) - '0'; n = … | |
hey alll..I posted earlier on needing help for a code on input #..base..print decimal form..I actually didnt learn this in high school so thats why I was having so much trouble :@ Now that I read up and understand the logic in bases..I was thinking that for my code I … | |
hey all!! I recently got this new laptop [URL="http://shop.lenovo.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:item.detail?GroupID=243&Code=085525U"]http://shop.lenovo.com/SEUILibrary/controller/e/web/LenovoPortal/en_US/catalog.workflow:item.detail?GroupID=243&Code=085525U[/URL] Id like to get a cooler since I use computer a lot. I see a lot of em at tigerdirect but unsure of which one to get. Recommendations!! ty!! *sorry if I posted in wrong section | |
heyy all :)) So im working on a new piece of code here..take into consideration that I love while loops and that's what I really want to use! so here is how the program would go read: # then read: base print: decimal representation thanksss :)) | |
[CODE]int m, n, pow; cout << "Enter m and n: "; cin >> m >> n; pow = 1; for (int i=1; i<=n; i++) pow = pow * m; cout << m << "^" << n << " = " << pow << endl; return 0; }[/CODE] I dont get … | |
BOOL is basically pretty intuitive.. my question: [CODE]#include "stdafx.h" #include <iostream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { double cost, finalPrice; bool type; type=true; //taxable cout << "Enter price: "; cin >> cost; if (type) finalPrice = cost*1.07 ; else finalPrice = cost; cout << "Final price: " … | |
heyyy guysss....just trying to make a code to proove .999=1 any ideass?? :)) ty!! | |
heyy all..I am really confused on the MOD (%) operator and how it is processed.. [CODE]int n; cout << "Enter n: "; cin >> n; for (int i=1; i<=n; i=i+1) if ( (i % 2) == 0) //even cout << "-"; else //odd cout << "^"; [/CODE] What exactly is … | |
I would like to make a program which allows you to enter a number (say 145). It reads the 3 CHAR and prints the largest one. I can make it to compare integers but where I am lost is how to compare characters in a single 145 (example) input so … | |
[CODE]#include <iostream> using namespace std; int main() { char a, b, c, d, e, f, max; cout << "enter a b c: "; cin >> a >> b >> c >> d >> e >> f; max = a; if(b>max) max = b; if (c>max) max = c; if (d>max) … | |
Ok so I played around with this for a while and it works..but I wana know the logic [CODE]#include <iostream> using namespace std; int main() { int number; int max = 0; cout << "enter number: "; cin >> number; while (number !=0) { if ((number % 10)> max) //rem … |
The End.