Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Prolog % Implement a predicate, tax, that asks simple questions on tax, then asks for possible tax credits, & stops when the user types stop.

Prolog

% Implement a predicate, tax, that asks simple questions on tax, then asks for possible tax credits, & stops when the user types stop. % The answer/output for each question should contain the usr's input. See the sample dialog below. % Suppose married filing jointly, see the federal tax rates below.

% $0 - $22,000: 10% % $22,001 - $89,450: 12% % $89,451 - $190,750: 22% % $190,751 - $364,200: 24% % $364,201 - $462,500: 32% % $462,501 - $693,750: 35% % $693,751: 37%

% Sample dialog: % ?- tax. % hello I am a taxbot. % please answer questions % or type "stop." if you want to exit! % What's your household income: $75,000 % The tax rate for $75,000 is 12%. % What tax credits you want to claim: child tax credit. % We'll help claim child tax credit for you. % What tax credits you want to claim: child care dependent credit. % We'll help claim child care dependent credit for you. % What tax credits you want to claim: education tuition. % We'll help claim education tuition for you. % What tax credits you want to claim: stop. % true.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions