The assignment is to plot the functions, by implementing a function having the following prototype:
void plotPoint(double y);
This function should print a single "*" symbol, in a position determined by the value of y, and then a newline. The position of the * symbol can span over 80 columns: each column should represent a delta of length 0.1 in the value of y, and the zero should be placed on the 40-th column.
For example: • placePoint(0) should print the * symbol on the 40th column • placePoint(0.1) should print the * symbol on the 41st column • placePoint(1) should print the * symbol on the 50th column • placePoint(-1) should print the * symbol on the 30th column
Here is what I have so far:
#include <iostream> #include <cmath> int a; int b; int x; int y; int Func1(double a, double b )/>
[Code] ....
I'm lost now as to where to go to plot. I know that depending on the option chosen I call the corresponding function to return a value for y which is just then plugged into a function to plot it on columns of y.
The requirement is to capture statistics of uuid occurrences for ALIVE/SEARCH/BYEBYE (it can be all 3, combinations of 2 each, or one alone) in a dynamically populated file in run time.
I am able to print all 3 combinations, but not in combination of 1 or 2 e.g.
I want to generalize the code such that uuid occurrence does not have to be all 3 (ALIVE/SEARCH/BYEBYE), the occurrences can be any combination and code should work. e.g my code gives wrong results when input.txt contains the following:
I have been skimming and searching but dont know how to word the search just right to find what I need to know. I have written simple stuff with the support of tutorials like weight conversion or loops counting up to a set number. Nothing amazing. The other day I found out how to input and print a string rather than a single text character which i though was bad ass. I even got it to read multiple strings on a single line and found a way to read multiple lines. I can even format it to read both integers and characters on the same line as long as I know the predefined format.
On to my question... How do I read multiple lines with both carecters and integers. for instance:
nissan 1996 toyota 1998 or more comples like nissan gtr 1996 toyota markii 1998
I want to use int year; char make[10]; maybe need to use char make[10][10]; for an array i would guess. char model[10]; optional for the extra data
but reproduce what i read in a different order. say... 1996 nissan 1998 toyota vice the original format.
this is what I have tried.
Code: scanf("%s %s", &make,&year);
//The way I seen to read multiple lines was on here
scanf("%[^/t]", %make);
But this wont let me separate the two into two differnet definded data types. Let alone use printf to display them in reverse order.
I am working on a program where a user first enters a key of 26 characters, they then choose the number of lines they'd like to use with a max length of 40. Once they have entered the key and chosen the number of lines, they then enter text into the chosen number of lines, before that text is ultimately encrypted. I have it working as far as accepting the user's 26-character key, accepting their choice for number of lines, but when the user is typing in their lines of text, it only allows 6 lines before it moves to where the text would be encrypted.
I have a certain method of encrypting text. You get the first character of the word. For example in the word "hacker", you get 'h', and then you get the last character 'r'. The encrypted word until now is "hr". Then we get the same word with the 'h' and 'r' removed, now it's "acke". I do the same thing and get the first character 'a' and the last one 'e' and them to the encrypted word: it is now "hrae".
The left letters of the word are "ck", again we do the same thing and take the first character 'c' and the last character 'k' and and add them to the new encrypted word so it is "hraeck". The above word has an even number of characters and at the end had 2 characters left 'c' and 'k',first and last, in some cases of words with an odd number of characters, only one character is left! I'm completely lost on how to encrypt and decrypt this.
From my understand the cast (reg8 *) applies to the result of the bitwise OR. But what is the left most asterisk doing?Is it just dereferencing the casted pointer?
i have to make a programs that prompts the user to enter quiz grades and add them up. For examples the user enters 6 test grades they are out of 5 so he enters 0-5 and i store them in the array. This part works great but now i have to print out a bar of vertical asterisks for every part too. So if at the end we have one test grades that are 2 grades of 1 points, 1 grade of two point, 2 grades of three point and 1 grade of 5 point it will have to display them as this
There are 2 grades of 1 There are 1 grades of 2 There are 2 grades of 3 There are 1 grades of 5
i need to do for loops but i am stuck on what to count too and what to print i know i will need cout << "*" and a couple of spaces.
#include <iostream> using namespace std; int main (){ int size; int tests; int a[6]={0};
cout << "How many quiz scores will you enter: "; cin >> size;
i have my basic C program here (i'm new to C language):
Code:
#include <stdio.h> int main() { int grade; int A=0; int B=0; int C=0; int D=0; int E=0;
[Code]....
As you can see, it's only for counting how many students got the grades from A to E, but the problem is that i need to change it from numbers into asterisk
for example: 4 students got the grade A, and 3 students got the grade B
So, I'm going to write a recursive function for a asterisk pattern but I'm stuck figuring out how to create a stopping case for it, better yet, I'm unable to describe the pattern completely.
* Every odd row has 1 * with 1 incremented white space
* Every "pair" of asterisks equals 8 total (EX. 8 one pair *'s, 4 two pair *'s, 2 four pair *'s)
Unfortunately, that's all I got. how I can represent this as I function. Once I figure out what my stopping case should be, I think I can do the coding on my own.
This program needs to display a vertical graph of asterisks showing production for each plant in the company ...
Here is what I have so far:
*********************************** This program will read data and display a vertical graph showing productivity for each plant. Reference Display 7.8 pg. 401-3 *********************************** */ #include <iostream>
Right now I'm working on an assignment where I need to take the data from on file encrypt it by adding 5 to each byte and then save it to a user specified location. I think I'm close to having it done but I've run into a hick up. After I get the user input for where the encrypted data should be saved the program seems to never end. This is the code I have so far
#include <iostream> #include <fstream> #include <string> using namespace std; int main() { ifstream input; ofstream output;
the code use in above link is good but one problem i cant able to use backspace to remove mistake if user made any mistake he cant able to remove the mistaken character
I'm a novice with C programming and i have to solve an error in the following code. The code works like you enter a password called "uoc" and it shows as OK. But surprisely when you entered another password as "Cambridge" it works fine too.
I think that the problem is in the array declaration but i'm checking resources and no success!
this is really important i searched an example code about "Username and Password Validation between Server and Client" through internet a LOT and i couldn't find anything..
"How to create login id and password" because i have to submit this assignment next weeks i dont know how to using passing by value or reference corectly/
For the Ouput its say this :
1>ClCompile: 1> GILA DAH!!.cpp 1>d:computer programmin ditg 1113jiwa ku sakitjiwa ku sakitGILA DAH!!.cpp(21): error C2664: 'strlen' : cannot convert parameter 1 from 'char' to 'const char *' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast 1> 1>Build FAILED.
Ive been working on a program that can mask the password and has 3 attempts. So far I can't do both at the same time. Here is my work. How can I do both?
#include<iostream> #include<string.h> #include<conio.h> using namespace std; int main() { string _pass; char input;