Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me solve this problem with c++ language. Your efforts are appreciated ! Thank you very much ! CPSC 1160: ASSIGNMENT 2[25 MARKS] Exercise

Please help me solve this problem with c++ language. Your efforts are appreciated ! Thank you very much !

image text in transcribed

image text in transcribed

CPSC 1160: ASSIGNMENT 2[25 MARKS] Exercise 1 [20 marks] Write a program that will ask the user for two numbers First is a base (a number between 1-16) 0123456789ABCDEF o Second is a length of the sequences ( it will always be less than or equal to 6) Your program should then generate all possible sequences of the given length for the given base. Your program should then print out all the sequences and the number of sequences that were generated YOUR SOLUTION MUST BE RECURSIVE You should write at least three functions int main() Which is the main function. Keep it brief generate(int, vector&, string & ,int ) Which should be a recursive function that generates all sequences Sample output 1202 1020 Enter u base3 1111 Enter a leng:h4 0202 C111 0020 2222 2102 2011 2210 1102 1222 1011 1210 0210 0222 0102 C011 2122 2002 2201 2110 1002 1122 12C1 1110 0122 0002 0201 0110 2022 2221 2101 2010 1022 1221 1101 1010 0022 0221 Cici 0010 2212 2121 2001 2200 1212 1121 1200 0212 0200 0121 COC1 2112 2021 2220 2100 1112 1021 1220 1100 0112 C220 0021 0100 2012 2211 2120 2000 1012 1211 1120 1000 0012 0211 C120 0000 2202 2111 2020 Count = 81 Note: I broke this into columns in word for readability, this is not how you have to output it Submissions Make sure that your code is neat and is well commented [5 marks] Check that all of your programs work the way they are intended to work by running them with different inputs Submit to D2L a zip/archive file containing only the .cpp you have written

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke

1st Edition

0130086509, 978-0130086501

More Books

Students also viewed these Databases questions

Question

Show that the rank of a matrix equals the rank of its transpose.

Answered: 1 week ago