Given two arrays (the first array and the second array) of the same size, each consisting of n positive integers, write a program to determine how many unique integers the second array has. Here a unique integer means that it shows only once in the second array but does not show in the first array. For example, if the first array is [1, 5, 3, 6, 8] and the second array is [2, 4, 2, 5, 9] (with n=5), the second array has two unique integers (4 and 9). What is the complexity of the program?

Member Avatar
Member Avatar
+1 forum 1

Hi guys the problem I'm having is declaring the operand "op". How do you do that? #include <iostream> #include <stdlib.h> using std::cin; using std::cout; using std::endl; #include "expression.h" // include definition of class Calculator // function main begins program execution int main() // print header for Calculator inventory display cout << "SuperCalculator at your service!" << endl; cout << "-----" << endl; // create Calculator object Calculator calculator; do{ // initialize calculator static double accumulator = 0; double input = 0; char operation = '+'; // begin loop do{ // get inputs from user and begin calculations cout << "Input: …

Member Avatar
Member Avatar
+0 forum 2

how can i print 3 values(without knowing their string\number size) in same column using cout? i'm using these code: cout <<"\n" << "show tokens\n"; for(unsigned int i=0;i<Tokens.size(); i++) { cout << "Token: " << Tokens[i].Token <<right<<setw(20-Tokens[i].Token.size())<< "Type: " << Tokens[i].Type <<setw(40) << fixed << "Position Line: " << i<<"\n"; } but i know the 'token' size, but not the type size. so what you can advice me?

Member Avatar
Member Avatar
+0 forum 1

hello i am developing an application in c ++ and mysql and i am having a lot of difficulties in more specified login in the query where the query needs the user and the pass which are in variables. Can anyone help me? Thanks.

Member Avatar
Member Avatar
+0 forum 5

How to solve this problem in Code Blocks? Output: Enter 1st number: 10 Enter 2nd number: 10 Enter 3rd number: 10 Enter 4th number: 10 Enter 5th number: 10 Sum of five numbers: 50 Average of five numbers: 10

Member Avatar
Member Avatar
+0 forum 1

Hello Everyone, I have an FPGA application that has some function (i.e: Matrix Multiplication) now I want to create the memory interface for FPGA communication based on the model pushed into the FPGA? For example, If we have the size of 1024 and the size of data is 10 bit how we can create memory interface a/c to the actual size? 1. What are the possibilities which can achieve this mechanism? 2. Can you help me to make pseudo-code or c-code? I am trying to used sds_lib.h (**same as #include <stdlib.h>**) functions but I have no idea how to that …

Member Avatar
Member Avatar
+0 forum 1

write a program to convert celsius to fahrenheit in c using do loop

Member Avatar
Member Avatar
+0 forum 1

I want a calender to appear, making it so that the customer can chose the dates. #include <iostream> #include <string> #include <ctime> using namespace std; double SubTotal=0.00,Total=0.00, Dis=0.00, DisGCH=0.40, DisConf=0.15, DisSpec=0.05; int NoOfDays=0, TelNumber, CreditCN, GoldCN, RPriceSing=175.00, RPriceDoub=250.00, ConfN; string LName, FName, Address,Occupancy, DisType,GoldCardHolder,ConfDel, CheckInDate; int main(){ cout<< "WELCOME TO SANDY SHORES BEACH HOTEL"<<endl; cout<< "Select Check In Date"<<endl; cin >>CheckInDate>>endl; // current date/time based on current system time_t now = time(0); // convert now to string form char* dt = ctime(&now); cout << "The local date and time is: " << dt << endl; // convert now to tm …

Member Avatar
Member Avatar
+0 forum 2

HI everyone, _SBLOCK *allocateMemBlock(size_t size) [ _SBLOCK *block = (_SBLOCK*)sbrk(0); void *memadr = (void*)sbrk(0); void *allocate_mem = (void*)sbrk(BLOCK_SIZE + size); if(allocate_mem == (void*)-1) [ return NULL; ] else [ block->next = NULL; block->isfree = false; block->size = size; block->memoryAddress = memadr+BLOCK_SIZE; return block; ]

Member Avatar
Member Avatar
+0 forum 7

can you please tell how you would invert the mouse control so that up is down, left is right etc.

Member Avatar
Member Avatar
+0 forum 21

[I]Last project for the semester and it's late!!! I am in need of some logic with this one....It seemed simple, but now it's out of control. My array with the ASCII converter works, but I can't seem to develop a complete output function to output this 'counter simulator.' Here's the problem and my code thus far:[/I]My mother always took a little red counter to the grocery store. The counter was used to keep tally of the amount of money she would have spent so far on that visit to the store, if she bought all the items in her basket. …

Member Avatar
Member Avatar
+1 forum 3

i'm creating a program using Code Blocks with GNU\GCC compiler. i'm using Windows 10 with Windows Defender. my program create a txt files(instead a text files, we can speak binary files too), but the Windows Defender can delete the file(and i have sure), for avoid these problem i must disable the Windows Defender. my question is: can i compile my program(even using a compiler\linker flag) for avoid the Windows Defender problems? ok.... i can disable the Windows Defender and make an exception.... but if i share my program, the new user will get the same problem :( can anyone advice …

Member Avatar
Member Avatar
+0 forum 16

#include<stdio.h> #include <iostream> #include<stdlib.h> using namespace std; int main() string custname,carmodel,carnum; int days=0,rentalfee=0; cout << "Sila isi nama anda : "; cin >> custname; cout<<endl; do{ cout<< "Sila berikan pilihan model kereta pilihan anda !"<<endl; cout<<"Tekan A untuk model Axia."<<endl; cout<<"Tekan B untuk model Saga."<<endl; cout<<"Tekan C untuk model Exora."<<endl; cout<<endl; cout<<"Kereta pilihan anda : "; cin >>carmodel; cout<<endl; if(carmodel !="A" && carmodel !="B" && carmodel !="B" ) cout<<"Pilihan model kereta tidak sah ! sila masuk semula !"<<endl; }while(carmodel !="A" && carmodel !="B" && carmodel !="C" ); cout << "Sila berikan maklumat berikut: "<<endl; cout <<"---------------------------------------"<<endl; cout<<"Kereta No. : "; …

Member Avatar
+0 forum 0

I need help with reading data from web page. I wanted to do database of rates (forex). For example: whan price is (eur\usd) 1.4231 then 1.4230 then 1.4229 then 1.4230. I wnated to make text file and application (c\c++) write there those price. In tex file: 1.4231 1.4230 1.4229 1.4230 every movement are in this file. It is possible ??? I know how can I make text file and write on it. But I need get data from web page.

Member Avatar
Member Avatar
+0 forum 8

Hi. I wanted to review the idea of "Link List" but using C++ and not Java. I borrowed a header file from a textbook to test how a link list works (I know that if I don't paste the whole code [its not my code anyway. It was from a textbook], it would be hard to help me but I don't want to copy the whole code from the text book. I will just show the functions that I am using. If my question still does not make sense, please mention it in the comment section below so that I …

Member Avatar
+0 forum 0

I need help with a code for averaging grades it works on a online compiler but it doesn't work on visual studio 2019

Member Avatar
Member Avatar
+0 forum 4

Hi there everybody just needed some help sorting an object array. So the array takes in a title, link, comment, length, and rating of the video. Once the values are put into the array the user inputs whether they want to sort it by title(alphabetically), length of the video (ascending order), and then rating of the video (descending order). The code runs and compiles perfectly fine right now but just dont know how to put in the place the sort functions. ** VIDEO.H** #ifndef VIDEO_H #define VIDEO_H class Video{ public: Video(string t, string l, string c, float time, int a); …

Member Avatar
+0 forum 0

[CODE]#include <iostream> using namespace std; int main() { int a,b,c, ope; cout<<"enter a value" << endl; cin >> a; cout<<"enter b value" <<endl; cin >> b; cout<<"enter operation (+ - * / and %)"; cin>> ope; if (ope == +) { c=a+b; cout<< c; break; } if (ope == -) { c=a-b; cout<< c; break; } else if (ope == *) { c=a*b; cout<< c; break; } else if (ope == /) { c= a/b; cout<< c; break; } else if (ope == %) { c=a%b; cout<< c; } else cout<<"entered wrong input"; return 0; } [/CODE] whats wrong with …

Member Avatar
Member Avatar
+0 forum 10

Hi All, i would need some advice from you guys from this forum to solve the reading of the CSV file that i had. for example, i have a file which consist of about 2000 records (below are the example of the records) 10/10/2013 10:25:09 AM,5.89,45,264.83,PTTTT 10/10/2013 10:25:13 AM,5.89,2000,11780.00, Some of the records are with the "PTTTT" and some dont. So how do i read the records for the part until 4th column and elimiate the PTTTT column ? Thanks

Member Avatar
Member Avatar
+0 forum 5

I am supposed to sort an array in ascending order..I have tried but then i cant get the results i want.I also tried to look it up in this forum but i still can't get it...Here is part of the code:[ICODE]void sort() { int size=10; int j,temp,i; for(i=0;i<(size-1);i++) { for(j=i+1;j<size;j++) { if(queue[i]>queue[j]) { temp=queue[i]; queue[i]=queue[j]; queue[j]=temp; } } } cout<<"Status: sorting done."<<endl; }[/ICODE] The result i getting is zero for everything...Please help me..

Member Avatar
Member Avatar
-1 forum 12

hi everyone...I need help on solving this question... Create a SavingAccount class. Use a static data member to contain the annualInterestRate for each of the saver. Each member of the class contains a private data member savingsBalance indicating the amount the saver currently has on deposit. Provide a calculateMonthlyInterest member function that calculates the monthly interest by multiplying the balance by annualInterestRate divided by 12; this interest should be added to savingsBalance. Provide a static member function modifyInterestRate that sets the static annualInterestRate to a new value. Write a driver program to test class savingsAccount. Instantiate two different savingsAccount objects, …

Member Avatar
Member Avatar
+0 forum 6

Like: if i Can saw what is Happening inside of my code i will understand what type of method i'm actually using ..Like: binary search or stack or Dynamic programming or using special type of algorithm which already developed by someone? Did you guys know ..how i can solve this type of issue? I know i need more practice than i can tell which process i'm using or not .. Is there any other option to recognize how to solve a Programming Problems?? If there was any it will be helpful.Thanks for your time and Experience .

Member Avatar
Member Avatar
+1 forum 2

I have trouble answering the following question. please help with codes for my practice sake. QUESTION: The table below shows the average rainfall and temperature during a rain season stored in a text file called Weather.txt Month Temperature Rainfall Chingola 23 27 Kitwe 24 27 Ndola 23 26 Kabwe 24 26 Lusaka 22 26 Kafue 24 16 Mazabuka 26 15 Monze 26 12 Choma 27 10 Livingstone 26 10 Write a program that reads this information from the text file, stores the values in parallel arrays and prints the information stored in the arrays to the screen. PLEASE HELP ASAP!

Member Avatar
Member Avatar
+0 forum 4

Hello. I am trying to write a program that solves the "quadratic equation" when given variables "A", "B" and "C" and find the number of zero's. One code is the definition, the next is the implementation and the last code it just the test file. I need help running the codes through a test file. To do this, I need to know which code must be written in the "Header File" and which code must be written in the ".CPP" file (I know the test file needs to be saved in a ".CPP file" already). After that, I also want …

Member Avatar
Member Avatar
+0 forum 1

Hello. I have to write a code that models a bank account using "C++". It must complete the following functions: (1) Make a withdrawal and deposit (2) change account owner (3) find balance on account (4) create new account However, I can not write all my code in one file but must use "Object Oriented Programming" to do this (it is more efficient). Unlike java (which I am more familiar with), to do this I must create one ".cpp" file, one .h" file and a test file in "C++". I don't think I have the correct idea when it comes …

Member Avatar
+0 forum 0

Hi, I'm learning C and I was trying to print this program using if-else statement: void main() { char* opinions; printf("What do you think of me?"); scanf("%s",&opinions); if (opinions="Ugly") { printf("Huh, I'm way more beautiful than your heart"); } else if (opinions="Blacksheep") { printf("Sometimes Blacksheeps end up shining the most!"); } else if (opinions="Self-Centered") { printf("Mark time, I've planned to share the most during my whole life"); } else {printf("You just know less then 1% about me"); } } But when I run it, I get the output of "if" state. The "elseif" and "else" statements are not working. What's …

Member Avatar
Member Avatar
+0 forum 7

I am new at this and not found online.

Member Avatar
+0 forum 0

Can you help me? *********************** A baggage counter charges $o.50 mimimum fee to deppsit a bag for up to 3 hours and an additional $0.25 for each hour or part thereof over 3 hours. Assume that no bags are deposited for longer than 6 hours time. Write a program that will calculate and print the baggage counter charges for each of the 5 costumers. Who deposited their bags at this counter. You should enter the hours deposited for each costumer. Your program should print the consults in a tabular format, and should calculate and print the total of all receipts …

Member Avatar
Member Avatar
+0 forum 1

Hello. I am taking a "Data Structures" class. I have to create a code that will print the following "Output": 8 6 4 2 0 6 4 2 0 4 2 0 2 0 0 I tried doing this code three different ways. Here is the first way. I did a similar project in "Java" so I knew I needed a "Nested Loop. I just "re-wrote" the code in "C++" but it does not print the correct numbers. I have to print the numbers in a way that the numbers count by "two's" and not "one's": for(int i = 8; …

Member Avatar
Member Avatar
+0 forum 1

Hi im new to programming and i need a bot that autofills a website because i constantly advertise a website on different websites and i basically copy and paste repeatedly for like 5 to 8 hours a day but my friend said i might be able to make a bot to help do it for me is this at all possible.

Member Avatar
Member Avatar
+0 forum 1

The End.