Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A company Digicom Parts manufactures 2 types of unique products for laptop and desktop computers. It manufactures 10 types of laptop products and 42 types
A company Digicom Parts manufactures 2 types of unique products for laptop and desktop computers. It manufactures 10 types of laptop products and 42 types of desktop products. Each product manufactured by the company has a unique productID from a-z and A-Z. The laptop product have productID (a, i, e, o, u, ALE, O, U) while the rest of the productIDs are assigned to the desktop products. The company manager wishes to find the sales data for the desktop products. Given a list of productIDs of the sales of the last N products, write an algorithm to help the manager find the productIDs of the desktop products.
Question of the last N products, write an algorithm to help the manager find the productIDs of the desktop products. Input The first line of the input consists of an integer numOfProducts, representing the number of products to be considered in the sales data (N). The second line consists of N space- separated characters - productID, productID...... productIDN representing the product IDs of the sales of the last N products. Output Print an integer representing the number of desktop products among the given sales data. Constraints 0 numOfProducts 106 Example Input: 6 avikel Output: 3 Explanation: The productIDs of the desktop products in the sales data are [v.k.l]. So, the output is 3. ... 2 1 // Header Files #include #include 3 4 #include 5 6 7 8 9 10 11 12 13 14 15 16 7 18 19 28 21 22 23 24 25 25 27 28 29 30 31 32 33 34 35 35 37 38 17 20 26 36 using namespace std; * productID representing the product IDs of th */ int calculateDesktop Product IDs (vector pr { } int answer; // Write your code here return answer; int main() { //input for productID int productID_size; cin >> productID_size; vector productID; for (int idx = 0; idx < productID_size; idx { } char temp; cin >> temp; productID.push_back (temp); int result = calculateDesktop Product IDs (produ cout < < result; return 0;
Step by Step Solution
★★★★★
3.45 Rating (164 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started