Apk
This is not a place to get urgent assignment answers
JORGE
Hello
Anonymous
🙏🙏
Anonymous
Good evening .... Has anyone bjarne stroustrup's C ++ Programming book in PDF format?
.
They have a variable equal to 5. Another variable has been declared, b. How to code so that variable b gets the value from the above variable a.
.
Can you help me please.
.
If the total price is less than $ 50, vat = 0% (0.00) If the total price ranges from $ 50 to $ 800, vat = 10% (0.10) If the total price is more than $ 800, vat = 20% (0.20)
.
Write the above program code and display the amount, vat and total (total = amount * (1 + vat))
Anonymous
Thank you rose
DEV 7
Given an array of length N and an integer x, you need to find all the indexes where x is present in the input array. Save all the indexes in an array (in increasing order). Do this recursively. Indexing in the array starts from 0. #include <iostream> using namespace std; int checknum(int *arr, int* output, int size, int num = 2) { static int index = 0; static int j=0; if (index >= 0) { int val = arr[index]; if (val == num) { output[j]=index; j++; } else if(index==size){ return j; } else { index++; return checknum(arr, output,size); } } return -1; } int main() { int output[50],sizeofoutput; int arr[5] = {1, 2, 2, 3, 4}; sizeofoutput=checknum(arr, output, 5); for(int i=0;i<=sizeofoutput;i++){ cout<<output[i]; } return 0; } this is my code but got runtime error
Letlhogonolo
Greetings guys I am new doing software engineering and I am using code blocks software to program any recommended textbook to best learn c/c++ language ?
Vikas
#include<iostream> using namespace std; void dummy(int* arr){ } int main(){ int arr[5][5]; dummy(arr); }
Vikas
But when passing 1d array it's working
Big Boss
can I ask win32 GUI development related questions here?
Big Boss
On Windows, there is this thing called “virtual list control/view”, we create the list control with LVS_OWNERDATA, then tell how many items we want it to show by sending LVM_SETITEMCOUNT message with desired number, say 1 million, the control handle the drawing and scrolling and notify parent asking for information (text, image, etc.) needed to draw a specific item. LVN_GETDISPINFO will then needs to be handled in user code for that https://docs.microsoft.com/en-us/windows/win32/controls/lvn-getdispinfo
Big Boss
On Windows, there is this thing called “virtual list control/view”, we create the list control with LVS_OWNERDATA, then tell how many items we want it to show by sending LVM_SETITEMCOUNT message with desired number, say 1 million, the control handle the drawing and scrolling and notify parent asking for information (text, image, etc.) needed to draw a specific item. LVN_GETDISPINFO will then needs to be handled in user code for that https://docs.microsoft.com/en-us/windows/win32/controls/lvn-getdispinfo
So I think we can in theory simulate a tree control based on a virtual list control by using the aforementioned mechanism and custom draw +- buttons and click event. The reason for doing this is that inserting millions of tree items into a tree control is slow. Now, my questions are: 1) How should the interface looks like? 2) How to quickly find the corresponding tree node by a given row index? Must also take into account of expand/collapse states of nodes.
ilyas
Can we use variable as column size?
if pass the array variables to function , array decay conversion apply to array. So only you can send pointer. In two dimensinoal array after first coulumn you can use.because it correspond to type of pointer.
Alex
Hi anyone with language C simplified short notes,kindly share I'll appreciate.
shriman_deepak
#include<bits/stdc++.h> using namespace std; int main() { int item[10],max,min; cout<<"Enter the value of items "; for(int i=0;i<10;i++) cin>>item[i]; max=item[0]; min=item[0]; for(int i = 0;i<10;i++) { if (max<item[i]) max = item[i]; if (min>item[i]) min= item[i]; cout<<"maximum is "<<max<<" minimum is "<<min; return 0; } }
shriman_deepak
i want to print the maximum and minimum value
shriman_deepak
what's wrong in this code ?
shriman_deepak
still it's not working
Madhav
still it's not working
If (condition) {task}
shriman_deepak
Yes
shriman_deepak
#include<bits/stdc++.h> using namespace std; int main() { int item[10],max,min; cout<<"Enter the value of items "; for(int i=0;i<10;i++) cin>>item[i]; max=item[0]; min=item[0]; for(int i = 0;i<10;i++) { if (max<item[i]) { max = item[i]; } if (min>item[i]) { min= item[i]; } cout<<"maximum is "<<max<<" minimum is "<<min; } }
shriman_deepak
right ?
Madhav
right ?
It runs now?
shriman_deepak
shriman_deepak
wrong output
Madhav
nope
Then I m a python programmer.. Sorry
shriman_deepak
ah it's okay 😁
shriman_deepak
I did and it worked Thanks btw
Letlhogonolo
What code should I use for moving any objects c++
Letlhogonolo
Like for example if I where to move the "hello world " which code can I use
Pavel
Like for example if I where to move the "hello world " which code can I use
This needs more explanation or an example, because it's really unclear what are you asking about
shriman_deepak
#include<bits/stdc++.h> using namespace std; int main () { int N,M,max=INT_MIN,index = 0; cin>>N; for(int i = 0;i<N;i++) { cin>>M; } for(int i = 0;i<N;i++) if (max<M) { index = i + 1; } cout<<index; return 0; }
shriman_deepak
What's wrong with this code ?
shriman_deepak
@progfunk
Darryl
Letlhogonolo
This needs more explanation or an example, because it's really unclear what are you asking about
I'm new to programming so I'm having difficulty explaining...but what I mean is when u build and run your program without any codes put it..I'm using code blocks it displays "Hello world" so if I want to move around that hello world using the ARROW keys how can I do so
shriman_deepak
What are you doing?
We measured the amount of rain (in millimeters) for N days. Write a program that determines the day on which the most rain fell.
shriman_deepak
index is the day on which maximum rain fell
Anonymous
We measured the amount of rain (in millimeters) for N days. Write a program that determines the day on which the most rain fell.
you should use an array to store the detections and then assign the maximum to a variable :)
Anonymous
pretty straightforward
shriman_deepak
you should use an array to store the detections and then assign the maximum to a variable :)
#include<bits/stdc++.h> using namespace std; int main () { int N,M,max=INT_MIN,index = 0; cin>>N; for(int i = 0;i<N;i++) { cin>>M; } for(int i = 0;i<N;i++) if (max<M) { index = i + 1; } cout<<index; return 0; }
shriman_deepak
So i should use array for M ?
Anonymous
#include<bits/stdc++.h> using namespace std; int main () { int N,M,max=INT_MIN,index = 0; cin>>N; for(int i = 0;i<N;i++) { cin>>M; } for(int i = 0;i<N;i++) if (max<M) { index = i + 1; } cout<<index; return 0; }
that's the trick, you just have to adapt it to your program int main() { int arr[4] = { 1, 2, 3, 4 }; int max = 0; for ( int i = 0; i < 4; ++i ) { if ( arr[i] > max ) { max = arr[i]; } } std::cout << max << '\n'; }
Pavel
I'm new to programming so I'm having difficulty explaining...but what I mean is when u build and run your program without any codes put it..I'm using code blocks it displays "Hello world" so if I want to move around that hello world using the ARROW keys how can I do so
If you want to move a line of code up or down, then you need to check your IDE settings (the code editor your use) to find what is the shortcut for that. Most of the IDEs use Ctrl+Shift+Up or Ctrl+Shift+Down combinations. Or you can just cut that code line, and paste it where you need it. Anyway if I understanding this question correctly, it's not really related to C/C++
Anonymous
How can you hack with C ++?
Anonymous
How can you hack with C ++?
You can "hack" with any language.
Anonymous
"Hack" is a VERY vague term
Anonymous
You're right
Anonymous
What C ++ books can you recommend?
Anonymous
You're right
I know I am, what do you mean lol?
Anonymous
What C ++ books can you recommend?
I always recommend to learn C first
Anonymous
I always recommend to learn C first
I know the basics of the language but I need something more advanced
Anonymous
This
Amu
does anyone know how to simulate a concurrent customer - supplier system in c++?
Amu
I need help on an assignment
Anonymous
So like, a stdin/out kind of project?
Amu
means they are running in parallel and the program has to be thread safe, stuff like mutex, locks, queues ….
Anonymous
Ok, but what does it do, tho? You need to multithread something
Tuana
Hello, I have homework
Amu
yes, It generates requests for the customer and also the supplier, multithreads a queue