C++ YOU WILL WRITE AN INTERACTIVE PROCRAM THAT COMPUTES THE DICIT SUM AND DICITAL ROOT OF A NONNECATIVE INTECER AND DETERMINES WHETHER THE INTEGER IS A HARSHAD NUMBER. THIS PROCRAM WILL USE A MODULAR...


C++ YOU WILL WRITE AN INTERACTIVE PROCRAM THAT COMPUTES THE DICIT SUM<br>AND DICITAL ROOT OF A NONNECATIVE INTECER AND DETERMINES WHETHER THE<br>INTEGER IS A HARSHAD NUMBER. THIS PROCRAM WILL USE A MODULAR DESICN AND<br>ITS OUTPUT WILL BE FORMATTED AS SHOWN IN THE SAMPLE RUNS. REUSE<br>VARIABLES WHERE POSSIBLE AND AVOID DECLARING VARIABLES FOR VALUES THAT<br>ARE CALCULATED AND USED ONLY ONCE, WRITE THE PROCRAM INCREMENTALLY.<br>FIRST, IMPLEMENTTHE DICITSUM FUNCTION AND PERFORN UNIT TESTINC ON IT,<br>SECONO, CODE THE ITOSOS FUNCTION AND ALSO PERFORN UNIT TESTING ON IT.<br>THIRO, YOU MAY THEN IMPLEMENT THE DICITIZE FUNCTION INCREMENTALLY<br>COMFÚTING ITS REFERENCE PARAMETERS ONE AT A TIME AND PERFORMING<br>EXHAUSTNE UNIT TESTING ON EACH PARAMETER BEFORE PROCEEDING TO THE NEXT<br>STEP. COMPUTE ITS ROOT PARAMETER WITHOUT DETEANINING SUCCESSIVE DICIT<br>SUMS,<br>I HAVE THE INT MAINC) FUNCTION WRITTEN AND I THINK I WRITE IT OKAY, I JUST NEED<br>HELP WRITING THE OTHER FUNCTIONS. NEED TO INCLUDE INT DICITSUM(LONC NO,<br>STRING ITOSOS(LONG N), AND VOID DICITIZEÇINT N, INT& ROOT, BOOLS HARSHADJ.I<br>ALSO THINK I FORCOT TO HINCLUDE SOMETHING BUT CANT FIND ANYTHING IN MY<br>NOTES<br>HERES WHAT I HAVE<br>#INCLUDE <1OSTREAM><br>#INCLUDE <STRINC><br>USING NAMESPACE STO;<br>INT MAINO<br>INT NUMN,ROOT;<br>BOOL HARSHAD:<br>COUT<<> NUM; IF (NUM<=8)><"you mjst="" enter="" a="" positve=""><"please enter="" a="" positive="" intecer";="" cin="">> NUM; WHILE (NUM<8); n="NUM;" else="" n="NUM;" if="" (n="">=1 &&N<=9)><><><"]="; else=""><«><><"";><><><><><><"true": else=""><"false"; return="" o;="" :="" and="" heres="" an="" example="" dutput="" enter="" a="" positive="" integer="" →5="" dicsum="" (5)="5" dicitalroot="" (5)="5" isharshad(5)="TRUE" "/="">
Extracted text: C++ YOU WILL WRITE AN INTERACTIVE PROCRAM THAT COMPUTES THE DICIT SUM AND DICITAL ROOT OF A NONNECATIVE INTECER AND DETERMINES WHETHER THE INTEGER IS A HARSHAD NUMBER. THIS PROCRAM WILL USE A MODULAR DESICN AND ITS OUTPUT WILL BE FORMATTED AS SHOWN IN THE SAMPLE RUNS. REUSE VARIABLES WHERE POSSIBLE AND AVOID DECLARING VARIABLES FOR VALUES THAT ARE CALCULATED AND USED ONLY ONCE, WRITE THE PROCRAM INCREMENTALLY. FIRST, IMPLEMENTTHE DICITSUM FUNCTION AND PERFORN UNIT TESTINC ON IT, SECONO, CODE THE ITOSOS FUNCTION AND ALSO PERFORN UNIT TESTING ON IT. THIRO, YOU MAY THEN IMPLEMENT THE DICITIZE FUNCTION INCREMENTALLY COMFÚTING ITS REFERENCE PARAMETERS ONE AT A TIME AND PERFORMING EXHAUSTNE UNIT TESTING ON EACH PARAMETER BEFORE PROCEEDING TO THE NEXT STEP. COMPUTE ITS ROOT PARAMETER WITHOUT DETEANINING SUCCESSIVE DICIT SUMS, I HAVE THE INT MAINC) FUNCTION WRITTEN AND I THINK I WRITE IT OKAY, I JUST NEED HELP WRITING THE OTHER FUNCTIONS. NEED TO INCLUDE INT DICITSUM(LONC NO, STRING ITOSOS(LONG N), AND VOID DICITIZEÇINT N, INT& ROOT, BOOLS HARSHADJ.I ALSO THINK I FORCOT TO HINCLUDE SOMETHING BUT CANT FIND ANYTHING IN MY NOTES HERES WHAT I HAVE #INCLUDE <1ostream> #INCLUDE USING NAMESPACE STO; INT MAINO INT NUMN,ROOT; BOOL HARSHAD: COUT<"please enter="" a="" positive="" integer";="" cin="">> NUM; IF (NUM<=8)><"you mjst="" enter="" a="" positve=""><"please enter="" a="" positive="" intecer";="" cin="">> NUM; WHILE (NUM<8); n="NUM;" else="" n="NUM;" if="" (n="">=1 &&N<=9)><><><"]="; else=""><«><><"";><><><><><><"true": else=""><"false"; return o; : and heres an example dutput enter a positive integer →5 dicsum (5) = 5 dicitalroot (5) =5 ?isharshad(5)=true return="" o;="" :="" and="" heres="" an="" example="" dutput="" enter="" a="" positive="" integer="" →5="" dicsum="" (5)="5" dicitalroot="" (5)="5" isharshad(5)="">
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here